3rd-party authentication does not work properly with new users
Description
When using openid connect authentication (tested with both Facebook and Keycloak) with a new user, an error occurs. It is possible to complete the registration by refreshing the page, but it has to be done at two moments. The config was working with Mobilizon 1.0.5 (not tested with 1.0.6).
Steps to Reproduce
- Setup a an openid connect provider
- Try to use it to register a new user
Expected behaviour:
I would expect the initial configuration of the user (choosing display name, etc.) to follow the first connection like it did before.
Actual behaviour:
Refreshing the page is needed to proceed with the user configuration.
Reproduces how often:
100% of time (tested with three newly created Keycloak accounts and one Facebook user)
Versions
Mobilizon: 1.0.7
yarn: 1.22.10
Firefox : 86.0
FreeBSD: 12.2-RELEASE-p4
Additional Information
Provider configuration (modified to remove sensitive information and realm name)
Ueberauth,
providers: [
facebook: {Ueberauth.Strategy.Facebook, [default_scope: "email"]},
keycloak: {Ueberauth.Strategy.Keycloak, [default_scope: "email"]}
]
config :mobilizon, :auth,
oauth_consumer_strategies: [
:facebook,
{:keycloak, "Compte Keycloak"}
]
config :ueberauth, Ueberauth.Strategy.Facebook.OAuth,
client_id: "id",
client_secret: "secret"
keycloak_url = "https://my.keycloak"
config :ueberauth, Ueberauth.Strategy.Keycloak.OAuth,
client_id: "id",
client_secret: "secret",
site: keycloak_url,
authorize_url: "#{keycloak_url}/auth/realms/realmname/protocol/openid-connect/auth",
token_url: "#{keycloak_url}/auth/realms/realmname/protocol/openid-connect/token",
userinfo_url: "#{keycloak_url}/auth/realms/realmname/protocol/openid-connect/userinfo",
token_method: :post
The error message associated with the error page (modified to remove instance url).
Error: Navigation cancelled from "/auth/keycloak/callback?session_state=76ee78ce-2839-456e-b082-e5c4571b572f&code=3dffbd7e-bb0a-4511-8c42-74b0c3f6e3b1.76ee78ce-2839-456e-b082-e5c4571b572f.4510f378-5adf-4d93-9051-53eb87b9f7ea" to "/register/profile" with a new navigation.
Qt@https://myinstance/js/chunk-vendors.30484898.js:16:17858
qt@https://myinstance/js/chunk-vendors.30484898.js:16:17592
8c4f/ee.prototype.confirmTransition/</<@https://myinstance/js/chunk-vendors.30484898.js:16:22165
r@https://myinstance/js/chunk-vendors.30484898.js:16:17174
r@https://myinstance/js/chunk-vendors.30484898.js:16:17212
$t@https://myinstance/js/chunk-vendors.30484898.js:16:17221
8c4f/ee.prototype.confirmTransition/<@https://myinstance/js/chunk-vendors.30484898.js:16:22122
r@https://myinstance/js/chunk-vendors.30484898.js:16:17174
r/<@https://myinstance/js/chunk-vendors.30484898.js:16:17203
p/<@https://myinstance/js/chunk-vendors.30484898.js:16:22031
Yt/</</u<@https://myinstance/js/chunk-vendors.30484898.js:16:18512
te/<@https://myinstance/js/chunk-vendors.30484898.js:16:19246