React-OpenIdConnect
React-OpenIdConnect copied to clipboard
userLoaded not called
I'm using an identity OAUTH server that returns an access_token. is this why userLoaded is not getting called? If not, any ideas why this isn't called?
We are running into the same problem, did you figure out what was wrong? access_token and id_token are specified in the url as expected, but still, only NotAuthenticated gets called.
@LasseMoench The code specifically looks for "#id_token" in the URL. If you have access_token, it might be first, so the code won't work.
This PR should help to fix this issue.
So you can create a function to overwrite the way that you check for the token or even implement anything else to do it.
...
class YourComponent extends Component {
...
checkAuthentication() {
return window.location.href.includes("my_token_hash");
}
render() {
return (
<Authenticate
OidcSettings={OidcSettings}
checkAuthentication={checkAuthentication}
userLoaded={this.userLoaded}
userunLoaded={this.userUnLoaded}
renderNotAuthenticated={this.NotAuthenticated}
>
<div>If you see this you are authenticated.</div>
</Authenticate>
)
}
}