react-oidc-context icon indicating copy to clipboard operation
react-oidc-context copied to clipboard

ID Provider asks for permissions on every login

Open luke7479 opened this issue 1 year ago • 4 comments

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

luke7479 avatar Jan 29 '24 19:01 luke7479

I do not know gitlab IDP, but i guess they are maybe using a session cookie to recognize you?

pamapa avatar Jan 30 '24 12:01 pamapa

Then it should work out of the box, as I am using the same session and a popup, or am I wrong?

luke7479 avatar Jan 30 '24 13:01 luke7479

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.

pamapa avatar Feb 02 '24 07:02 pamapa

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).

DanilKlochkov avatar Apr 09 '24 14:04 DanilKlochkov