Open lmm-git opened 1 month ago
Hi @lmm-git , I really prefer option 2 and code everything with data information. I'am lacking of time so i code first iteration with ugly exception :/
Do you need it quickly? I think i will be pretty busy during june.
Hi, thanks for your quick response!
for now, I can make use of my little hack. If it gets fixed some time in future it is fine for me as I just don't want to use a library which does not want to support this use case. But this doesn't seem to be the case here ^^
Personally, I like option 2 more as well, but this is definitely a breaking change if you don't want to create a new function for it.
Issue and Steps to Reproduce
I am using
oidc-client
(not the react variant).Some IdPs like Keycloak support authentication with property `prompt=none. This causes the IdP typically to redirect a user directly back to the application if there is no active session without prompting the user to authenticate. This is also how abort buttons on some IdPs are implemented.
In such case, the IdP is redirecting back to the application with an
error
anderror_description
. However, currently the library just raises a generic Exception in this case: https://github.com/AxaFrance/oidc-client/blob/630b4faed4ff275712f2f2ae00be64f8587cfc4b/packages/oidc-client/src/login.ts#L116This is a problem in multiple instances:
Both problem could be solved by
LoginCallback
object with additional details (like whether the login was successful etc.).Which option do you think is the best one? Or does the library already support this use case and I just overlooked it?
Versions
@axa-fr/oidc-client 7.22.6
Additional Details
One could circumvent this issue by reading the redirection URL before calling
loginCallbackAsync
viaand detecting the error like
But this is really hacky. Additionally, the
initSession
script is not intended to be used directly I think.