Having an issue where the jwt token I get from my first api doesnt work with the second (keeps telling me the token is expired). My Jwt setup for the api issuing the token is:
Plugins.Add(new AuthFeature(() => new CustomUserSession(),
new IAuthProvider[] {
new AwsCognitoAuthProvider
(
cognitoSettings.UserPoolId,
cognitoSettings.AppClientId,
container.GetService<IUserManager>()
),new JwtAuthProvider(AppSettings)
{
AuthKey = commonKey,
UseTokenCookie = true,
ExpireTokensIn = TimeSpan.FromHours(1),
UseRefreshTokenCookie = true,
ExpireRefreshTokensIn = TimeSpan.FromDays(3),
CreatePayloadFilter = (payload, session) =>
{
payload[@"email"] = session.Email;
payload[@"organizationId"] = ((CustomUserSession) session).OrganizationId.ToString();
payload[@"userId"] = ((CustomUserSession) session).UserId.ToString();
},
PopulateSessionFilter = async (session, payload, req) =>
{
((CustomUserSession) session).Email = payload[@"email"];
((CustomUserSession) session).OrganizationId = payload[@"organizationId"].ToGuid();
((CustomUserSession) session).UserId = payload[@"userId"].ToGuid();
},
}}
));
}
The api setup that is complaining about an expired token:
private void SetupAuthorization()
{
Plugins.Add(new AuthFeature(() => new AuthUserSession(),
new IAuthProvider[] {
new JwtAuthProviderReader(AppSettings) {
AuthKey = commomKey
},
}));
}
Using the same AuthKey between the two api’s not sure why this isnt working.