Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No meta tags generated when course requires login #10

Open
lwilson opened this issue Oct 12, 2017 · 2 comments
Open

No meta tags generated when course requires login #10

lwilson opened this issue Oct 12, 2017 · 2 comments

Comments

@lwilson
Copy link

lwilson commented Oct 12, 2017

The twittercard plugin works for our main site page (https://learn.tacc.utexas.edu), but it can't seem to generate cards for specific courses (I've been using https://learn.tacc.utexas.edu/course/view.php?id=10 as a test).

When I use cURL to pull the HTML, it appears that the URL resolves to an automatic redirect:

$ curl -A "Twitterbot" -v -1 "https://learn.tacc.utexas.edu/course/view.php?id=10"
*   Trying 129.114.97.176...
* Connected to learn.tacc.utexas.edu (129.114.97.176) port 443 (#0)
* found 173 certificates in /etc/ssl/certs/ca-certificates.crt
* found 692 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*        server certificate verification OK
*        server certificate status verification SKIPPED
*        common name: learn.tacc.utexas.edu (matched)
*        server certificate expiration date OK
*        server certificate activation date OK
*        certificate public key: RSA
*        certificate version: #3
*        subject: C=US,postalCode=78711,ST=TX,L=Austin,street=1 University Station,O=The University of Texas at Austin,OU=TACC - Texas Advanced Computing Center,CN=learn.tacc.utexas.edu
*        start date: Tue, 15 Aug 2017 00:00:00 GMT
*        expire date: Fri, 14 Aug 2020 23:59:59 GMT
*        issuer: C=US,ST=MI,L=Ann Arbor,O=Internet2,OU=InCommon,CN=InCommon RSA Server CA
*        compression: NULL
* ALPN, server accepted to use http/1.1
> GET /course/view.php?id=10 HTTP/1.1
> Host: learn.tacc.utexas.edu
> User-Agent: Twitterbot
> Accept: */*
>
< HTTP/1.1 303 See Other
< Date: Thu, 12 Oct 2017 16:46:38 GMT
< Server: Apache/2.4.18 (Ubuntu)
< Set-Cookie: MoodleSession=1m3pto2c55ha8tps6qa04savc6; path=/; secure
< Expires: Thu, 19 Nov 1981 08:52:00 GMT
< Cache-Control: no-store, no-cache, must-revalidate
< Pragma: no-cache
< Location: https://learn.tacc.utexas.edu/login/index.php
< Content-Language: en-us
< Content-Length: 449
< Content-Type: text/html; charset=utf-8
<
<!DOCTYPE html>
<html  lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Redirect</title>
* Connection #0 to host learn.tacc.utexas.edu left intact
</head><body><div style="margin-top: 3em; margin-left:auto; margin-right:auto; text-align:center;">This page should automatically redirect. If nothing is happening please use the continue link below.<br /><a href="https://learn.tacc.utexas.edu/login/index.php">Continue</a></div></body></html>

Is there a specific way the course needs to be setup for the callbacks to work? Am I using the wrong URL perhaps?

Thanks!

@scara scara added the question label Oct 12, 2017
@scara
Copy link
Owner

scara commented Oct 12, 2017

Hi Lucas,
303 is the HTTP status used by Moodle to redirect you to the login page: this will happen to those courses restricted to "selected" i.e enrolled users.

To let the card work, you should think about the course visibility: meta tags are there - except for bugs - but Twitter cannot access them since the course page is restricted to enrolled users i.e. it requires a valid user.

Unfortunately the course cannot be opened to Twitter unless changing some logic to mimic what already available for Google (https://docs.moodle.org/33/en/Search_engine_optimization#Moodle_settings).

HTH,
Matteo

@scara
Copy link
Owner

scara commented Mar 7, 2018

Follow up: I'm still looking for a nice solution and the discussion in MDL-61586 would provide some good pointers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants