soofstad / react-oauth2-pkce

Provider agnostic OAuth2 Authorization Code flow with PKCE for React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

💡 [FEATURE] - Option in login()-function to not redirect, but instead do it in an iframe or popup

soofstad opened this issue · comments

Summary

Scenario

  1. The user has already logged in (has a cookie from the IDP)
  2. The user need a new token with a different claim than the one configured in authConfig

Basic Example

<Button onClick={()=>login(mode='iframe', extraParams={"scope": "oldClaim newClaim")}>

Drawbacks

none

Unresolved questions

No response

Implementation PR

No response

Reference Issues

See discussion #146

Just a comment on this one: If you use the popup functionality, then any postLogin callback will be called in that window, not in the main window.
That's a caveat with the current implementation that one should be aware of.