ID Provider asks for permissions on every login
Hey, first: Thanks for this ibrary, makes my life a lot easier.
I am using Gitlab as ID provider. Authentication seems to be working fine so far, BUT.. Everytime I authenticate (even if my workflow is login -> logout -> login) gitlab is asking me to give permissions to share my details. Seems like gitlab is not recognizing my browser/device on second login, but I can't point my finger on the cause..
My oidcConfig:
import { WebStorageStateStore } from "oidc-client-ts";
import { AuthProviderProps } from "react-oidc-context";
export const oidcConfig: AuthProviderProps = {
authority: "https://gitlab.my.domain/",
client_id: "somerandomchars",
client_secret:
"gloas-somerandomchars",
scope: "profile openid email",
redirect_uri: window.location.origin + "/auth/callback",
userStore: new WebStorageStateStore({ store: window.localStorage })
};
My Login Button:
<Button
onClick={() => {
auth.signinPopup().catch(console.error);
}}
>
Login
</Button>
And my logout button is:
<Button
onClick={() => {
auth
.removeUser()
.catch(console.error);
}}
>Logout</Button>
Thanks in advance
Sascha
I do not know gitlab IDP, but i guess they are maybe using a session cookie to recognize you?
Then it should work out of the box, as I am using the same session and a popup, or am I wrong?
Then it should work out of the box, as I am using the same session and a popup, or am I wrong?
You are most probably right. You have to dig into this, its hard to guess what the problem is.
I have a similar problem with Gitlab, but I need to clear this cookie (like "_gitlab_session") to allow the person to login with other accounts, but now all users renew session when start signinPopup. Oidc configs like luke7479's (only scopes are different).