This repository was archived by the owner on Dec 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 597
Add OIDC remote sign-out to the sample. #613
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#423 (comment)
IMHO, this comparison will unlikely work everywhere, since there's absolutely no obligation for an OP to use the same values for
sid
andsession_state
.Identity Server, for instance, derives the session state from the session id (IIRC, it concatenates the session id and the client id and adds some salt) so you can't compare both values.
I guess it's probably not a big deal since it's just an AAD sample, but if you wanted it to be a general guidance, it would be something to fix.
/cc @leastprivilege
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the spec says what those are supposed to be. Maybe AAD does it differently then the spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The specs are rather permissive as the only requirement is to include the client identifier, the origin URL and the initial state in the session state 😄
http://openid.net/specs/openid-connect-logout-1_0.html
http://openid.net/specs/openid-connect-session-1_0.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, but as you point out they're not the same thing (except in AAD I guess where the spec is a more of a mild suggestion on how to do things). Point being, the check above shouldn't really work. You need to keep the sid from the original id_token and not the session state from the authorization response.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. The weird thing is that it works with AAD (but maybe it's not that weird? 😄)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so where does the
sid
claim come from? It's not necessarily the same thing as the session_state in the authorization response. Claims, from the client's perspective, are obtained in the id_token, no? Is ADD expecting a client to use the session_state value for this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the contract is: if discover.logout_session_supported==true, then a 'sid' claim should show up in the id_token. I agree that session_state is a different thing, however I suspect the that it may be the same value, since the idp will probably do similar things with it. It's confusing that the two 'logouts' have a different model for the session identifier, found in two different places.
My take is that AAD is not supporting the 'sid' yet. We added a property to support this in OIDCConfiguration - HttpLogoutSupported, I think RC1. Not sure, but it is there now. You can just check the metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, session_state can be the same as the sid, but a client should not have to know the particularities of the implementation and do things that aren't described in the spec (such as using the session_state instead of the [absent] sid for this type of check).
i guess what's confusing to me is why doesn't AAD just do an AAD-specific MW and leave the protocol focused MW in the ASP.NET team's hands? AAD has already created AAD-specific libraries with ADAL, so why not this too? or perhaps that would expose too many of these lax protocol compliance issues in AAD. these are the sorts of issues OIDC was meant to fix with OAuth2. or maybe it's the fault of the spec authors all being too lax given all the vendors' influence.
i know this isn't your your fault @brentschmaltz, but i'm just expressing frustration that these AAD specifics seem to crop up frequently in what's purported to be a protocol library. and i apologize to @Tratcher for hijacking his PR with my off topic comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we're all reviewing an AAD sample that relies on a feature that AAD doesn't support? #YOLO
@brockallen nah, let's integrate ADAL directly in the OIDC middleware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brockallen I think you are correct, the 'session_state' belongs in a AAD-specific MW. We should just rely on the 'sid' claim. We shouldn't muddy the waters.