-
Notifications
You must be signed in to change notification settings - Fork 118
SignedOut Callback not invoked with exising samples #6
Comments
Thank you much for that comment - that had me stumped! |
Just spent the entire day troubleshooting and debugging this issue. OpenIdConnectHandler.cs (v1.1.0) : protected virtual Task<bool> HandleSignOutCallbackAsync()
{
StringValues protectedState;
if (Request.Query.TryGetValue(OpenIdConnectParameterNames.State, out protectedState))
{
var properties = Options.StateDataFormat.Unprotect(protectedState);
if (!string.IsNullOrEmpty(properties?.RedirectUri))
{
Response.Redirect(properties.RedirectUri);
return Task.FromResult(true);
}
}
return Task.FromResult(true);
} The reason for the failure is that
Obviously, it cannot decrypt data previously encrypted by another protector which most certainly used a different encryption key. public TData Unprotect(string protectedText, string purpose)
{
try
{
if (protectedText == null)
{
return default(TData);
}
var protectedData = Base64UrlTextEncoder.Decode(protectedText);
if (protectedData == null)
{
return default(TData);
}
var protector = _protector;
if (!string.IsNullOrEmpty(purpose))
{
protector = protector.CreateProtector(purpose);
}
var userData = protector.Unprotect(protectedData);
if (userData == null)
{
return default(TData);
}
return _serializer.Deserialize(userData);
}
catch
{
// TODO trace exception, but do not leak other information
return default(TData);
}
} Therefore, no redirect is sent to the user agent. |
Man, oh, man. Thank you. Where do I send the beer? This was making me nuts. |
I don't believe this is applicable anymore with the updated 1.1 sample. I'll close the issue. Let me know if this is still and issue and we can reopen/revisit. |
When using multiple policies and the non-default values for
CallbackPath
on the OIDC middlewhere, at least with version1.1
, it seems like you also need to specify overrides ofSignedOutCallbackPath
andRemoteSignOutPath
for the post logout callbacks to be invoked correctly:I currently have the following in my
CreateOptionsFromPolicy
, which seems to work.The text was updated successfully, but these errors were encountered: