Closed SrMouraSilva closed 2 years ago
Hi @SrMouraSilva,
Thank you very much for your awesome and rich issue !
I just merge the v4 to master. It is stable now. I will remove beta as soon as I have finished migration guide and added more unittest.
Try the v4 demo, I think it do what you need to do => https://github.com/AxaGuilDEv/react-oidc#run-the-demo
Here you can find a demo https://black-rock-0dc6b0d03.1.azurestaticapps.net/
Feature requests
Hello! I want to request the possibility to add:
Obs: I'm using
@axa-fr/react-oidc-context
v3Custom redirect logins
Suppose that I access a specific page of an application
but I'm not signed... Then the application will move me to the login page. After I'm logged, I expect that the redirect page is the page that I was tried to access.
Currently, the redirect page is always the defined redirect url in configuration (If I understood).
Looking the v4, I saw the following example:
That apparently will be support of it. But I also saw this description:
Login state
I'm using the hook version. When I was tried to login with
signinSilent
I noticed an error
Uncaught (in promise) ErrorResponse: login_required
in console, but I couldn't access the error (or nether the login request state). I would like to uselogin
as afallback
of thesigninSilent
.Apparently, at the version 4 the login function returns a promise. But isn't clear how it will work (it will be silent or not silent or both?).
Custom scopes
I also want to the login method add custom scopes. Usage example:
Suppose that in my application I'm using the following scopes:
openid read
. In a specific moment, an user want to access the admin area of the application, this area is only enable if the user contains theadmin
special scope. By authorization restriction, I an application want to use theadmin
scope, the OIDC server will request to the user if their permits its use. So, my application will only request this special scope when the user press the buttonAdmin area
. This process is done by requesting again the login, but informing the additionaladmin
scope.Not force login
I want to the my application do this following flow:
I tried, but only did when
<AuthenticationProvider isEnabled={false}
. I noticed that after is logged, theisEnabled
continues to befalse
.I don't know if it is disabled will occur some problem, like token won't be refreshed.
If is a problem, I expect that exists some option in
<OidcSecure>
to don't force the login.Versions
v3 / v4?
Additional Details
@axa-fr/react-oidc-context
v3