-
Has anyone successfully got this template to work in Azure. I managed to publish out to Azure app service but got a weird issue happening. After creating an account, when I login and click on Todo or JWT, I would get "There was an error signing in". I did a bit of debugging and this error come from the client side in authorize.service.ts in side completeSignIn function. When this error happens, on the server the following exception is thrown: 2021-09-05 09:21:30.161 +00:00 [Error] IdentityServer4.Validation.AuthorizeRequestValidator: Unknown client or not enabled: DyfbaBeduvgfdghef.JfcHV Anyone got any idea? Notes: works fine on my local machine in both debug and release mode, only problematic when trying to run this on Azure. Fetch Data ( Weather Forecast ) works fine. Only when I lick on Todo and JWT i'll get that error message. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok, figured out the problem and found a solution. I traced it down to the completeSignin function in autorize.service.ts in the client app. The error is thrown in this function: public async completeSignIn(url: string): Promise { I inspected the error and it said "iat is in the future". I googled that error message and lead me to this one onelogin/onelogin-oidc-node#6 where someone there had a similar issue. After reading the comment there, I change my system date time setting to Set Time Automatically and it started to work. It also explains why it work on my local machine and doesn't work when i deployed it to Azure. Just posting my solution here as it might help someone who may run into it in the future. |
Beta Was this translation helpful? Give feedback.
Ok, figured out the problem and found a solution. I traced it down to the completeSignin function in autorize.service.ts in the client app. The error is thrown in this function:
public async completeSignIn(url: string): Promise {
try {
await this.ensureUserManagerInitialized();
const user = await this.userManager.signinCallback(url);
this.userSubject.next(user && user.profile);
return this.success(user && user.state);
} catch (error) {
console.log('There was an error signing in: ', error);
return this.error('There was an error signing in.');
}
}
I inspected the error and it said "iat is in the future". I googled that error message and lead me to this one onelogin/onelogin-oidc-node#6 wher…