asp.net core mvc - Keycloak in infinite loop - `invalid_grant` -
"message contains error: 'invalid_grant', error_description: 'code expired', error_uri: 'error_uri null'."
i receive error during onremotefailure
event. not sure how tell keycloak reset.
events = new openidconnectevents { onauthorizationcodereceived = context => { return task.fromresult(0); }, ontokenresponsereceived = context => { var idtoken = context.tokenendpointresponse.idtoken; refreshtoken = context.tokenendpointresponse.refreshtoken; return task.fromresult(0); }, onredirecttoidentityprovider = context => { return task.fromresult(0); }, ontokenvalidated = context => { accesstoken = context.tokenendpointresponse.accesstoken; context.ticket.principal.identities.first().addclaim(new claim("access_token", context.tokenendpointresponse.accesstoken)); return task.fromresult(0); }, onticketreceived = context => { var identity = context.principal.identity claimsidentity; if (identity != null) { if (!context.principal.hasclaim(c => c.type == claimtypes.name) && identity.hasclaim(c => c.type == "name")) { identity.addclaim(new claim(claimtypes.name, identity.findfirst("name").value)); } } return task.completedtask; }, // here in case user denies app permissions access requested resources onremotefailure = context => { context.response.redirect("/"); context.handleresponse(); return task.fromresult(0); } }
Comments
Post a Comment