-
Notifications
You must be signed in to change notification settings - Fork 694
loadUserProfile() : Error performing password flow TypeError: Cannot read property 'toLowerCase' of null #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm facing same Issue here .. Are there is any updates regarding it ??? |
make this on the redirectUri page : private configureWithNewConfigApi() {
} |
I have the same issue. i publish to server. in my computer login is OK. I use password type but in other computer throw the error: |
try to call it into this this.oauthService.loadDiscoveryDocument().then(() => { } |
I ran into the same issue. In my case, I was using plain oauth instead of OIDC, so I had no discovery document and had to configure various parts myself. In my case, I got the error because a call to http was done with an empty URL as I hadn't configured the tokenEndpoint. The issue went away as soon as I had it configured. Furthermore, I had to adjust the setting as the default one for requireHttps is This might not be the same issue that was encountered here but it might help with debugging down the line. |
I resolve by using:
|
…ointUrl #260: Improve error handling on missing tokenEndpoint
Looking at the history and merges I think this issue can be cleaned up now? Let us know, here or in a fresh issue, if you encounter problems still. |
@jeroenheijmans Still getting the same issue with |
Would you be able to create a fresh StackBlitz or repository with a minimal repro? The original post is old, and a tad hard to read. Also, you may have the same symptom, but could be that the root cause has changed since 2018... |
@jeroenheijmans Case is same it's working fine in login process .
but when we reload page after login then it's showing error
with below code
Follow steps to replicate:
|
Hmm, I can imagine a few things that trigger the error with the given code. The most likely culprit is that you might be trying to load the user profile before the other initialization has properly taken place. I would probably do something like this in the this.oauthService.events
.pipe(filter(e => ['token_received'].includes(e.type)))
.subscribe(e => this.oauthService.loadUserProfile()); Or otherwise make sure |
Hello, I am facing quite the same error calling "this.oAuthService.revokeTokenAndLogout()" for logout. "angular-oauth2-oidc.js:2374 Error revoking token TypeError: Cannot read property 'toLowerCase' of undefined" Any solution on this? Tks. |
I was getting the same error after calling: My auth guard was:
By adding |
I have used below code and it worked for me
|
Hi,
I want to get user profile, so i used it like this :
const user = this.oauthService.loadUserProfile()
console.log(user,
user
);My conf :
export const authConfig: AuthConfig = {
clientId : 'vegaJs',
redirectUri : 'http://localhost:5002/#/dashboard?',
responseType : 'id_token token',
scope : 'openid profile vega',
postLogoutRedirectUri : 'http://localhost:5002/',
issuer: 'http://localhost:5000',
}
LoginAuthComponent :
claims: any;
constructor(private oauthService: OAuthService) {
}
private configureWithNewConfigApi() {
this.oauthService.configure(authConfig);
this.oauthService.oidc = true;
this.oauthService.setStorage(sessionStorage);
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
this.oauthService.loadDiscoveryDocument().then(() => {
this.oauthService.tryLogin({});
});
}
public login() {
this.oauthService.initImplicitFlow();
}
public logoff() {
this.oauthService.logOut();
}
public getInfo() {
const user = this.oauthService.loadUserProfile()
console.log(user,
user
);}
when i call get info, I have Error performing password flow TypeError: Cannot read property 'toLowerCase' of null
The text was updated successfully, but these errors were encountered: