Closed ranouf closed 6 years ago
Hi, did you find the issue? Can you paste the stacktrace or something?
Hi,
So finally, i Just removed the Auth0 validation on client side, my server will do it. To do that, I updated my code: login.component.ts
ngOnInit() {
this.route.fragment.subscribe(
(fragments) => {
if (fragments) {
let params = new URLSearchParams(fragments.split('#')[0]);
let access_token = params.get('access_token');
let id_token = params.get('id_token');
let userInvitationId = params.get('state');
this.auth.handleAuthentication(access_token, id_token, userInvitationId);
}
}
);
}
And auth.service.ts
public handleAuthentication(access_token: string, id_token: string, userInvitationId: string ): void {
if (access_token && id_token) {
localStorage.setItem('access_token', access_token);
localStorage.setItem('id_token', id_token);
this.authenticationService.authenticate(userInvitationId)
.subscribe(result => {
this.authentified.next(result);
localStorage.setItem('user', JSON.stringify(result));
}, error => {
this.snackbarService.displayError(error.message);
});
}
}
I hope it will help you too :)
Thanks. We don't recommend bypassing the id_token verification, since it validates state, nonce, expiration time, jwks etc. Are you doing everything on the server? if that's the case, why use id_token at all?
Hi,
I just upgraded to Angular 5 and I Have an "Invalid token" error now. Every thing worked find before.
Here are my packages:
Here is the ts function:
Can you help to find the solution?