I've created a new site using https://github.com/plone/2024.ploneconf.org and am trying to configure the GitHub logins.
I went to https://github.com/settings/developers and created a new app. I copied the "Client ID" and the client secret to the JSON configuration in my site's @@authomatic-controlpanel
{
"github": {
"id": 1,
"display": {
"title": "Github",
"cssclasses": {
"button": "plone-btn plone-btn-default",
"icon": "glypicon glyphicon-github"
},
"as_form": false
},
"propertymap": {
"email": "email",
"link": "home_page",
"location": "location",
"name": "fullname",
"avatar_url": "portrait",
"username": "github_username"
},
"class_": "authomatic.providers.oauth2.GitHub",
"consumer_key": "the_client_ID",
"consumer_secret": "a_generated_client_secret",
"access_headers": {
"User-Agent": "Plone (pas.plugins.authomatic)"
}
}
}
The "Authorization callback URL" is a required field, but I didn't know what to put in it. I have not found documentation that helps in that regard. I tried putting in the site URL, e.g., https://mysite.com, but that did not seem to work.
Looking at the source for pas.plugins.authomatic, it seemed like https://mysite.com/authomatic-handler could be a good guess, as per https://github.com/collective/pas.plugins.authomatic/blob/d35f00ea0099d5264531a45dc84c024cdf0de0d9/src/pas/plugins/authomatic/browser/configure.zcml#L27C13-L27C31 but setting that and trying to log in would give me an error page like this
I thought that generating a new client secret (and updating my site's JSON) would help get past that, and it seemed to, because I no longer got that error but was taken back to the /login page with an error at the bottom
Then a friend cough(@ericof)cough asked me whether the site is Classic or Volto and since it's Volto he suggested that the callback URL should be https://mysite.com/login-authomatic/github, so I tried that but still get that Login Failed error. https://mysite.com/login-authomatic/ does not work either.
It would be lovely to have a simple walk through of what needs to be entered and done to get this plugin working with GitHub and Google... I'm happy to add one for whichever provider I can get working.