-
Notifications
You must be signed in to change notification settings - Fork 780
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement OIDC RP-Initiated Logout #259
Conversation
Codecov Report
@@ Coverage Diff @@
## master #259 +/- ##
==========================================
- Coverage 73.93% 72.25% -1.68%
==========================================
Files 58 63 +5
Lines 5102 5374 +272
==========================================
+ Hits 3772 3883 +111
- Misses 1330 1491 +161
Continue to review full report at Codecov.
|
27b4833
to
8680736
Compare
LGTM! Awesome! |
@param redirectonURL The second redirect URI to compare. | ||
@return YES if the URLs match down to the path level (query params are ignored). | ||
*/ | ||
+ (BOOL)URL:(NSURL *)URL matchesRedirectonURL:(NSURL *)redirectonURL { |
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.
Typo matchesRedirectionURL
OIDIsEqualIncludingNil(standardizedURL.host, standardizedRedirectURL.host) && | ||
OIDIsEqualIncludingNil(standardizedURL.port, standardizedRedirectURL.port) && | ||
OIDIsEqualIncludingNil(standardizedURL.path, standardizedRedirectURL.path); | ||
NSURL *standardizedRedirectURL = [redirectonURL standardizedURL]; |
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.
[redirectionURL standardizedURL]
- (BOOL)shouldHandleURL:(NSURL *)URL { | ||
/*! @brief Does the redirection URL equal another URL down to the path component? | ||
@param URL The first redirect URI to compare. | ||
@param redirectonURL The second redirect URI to compare. |
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.
Typo redirectionURL
BOOL authorizationFlowStarted = | ||
[_externalUserAgent presentExternalUserAgentRequest:_request session:self]; | ||
if (!authorizationFlowStarted) { | ||
NSError *safariError = [OIDErrorUtilities errorWithCode:OIDErrorCodeSafariOpenError |
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.
I know this is not directly related to this PR, but I wonder if this error type should be renamed to something like OIDErrorCodeBrowserOpenError
or OIDErrorCodeExternalUserAgentOpenError
since AppAuth now supports other browsers? The description is also mentioning Safari.
8680736
to
8aad291
Compare
I've been looking for a nice way to handle logout and this PR looks great. I've tested it in my project and it works great, except that the completion is not called. I've had a look at the code and it looks like I'm not fluent in the openid spec, but is this really expected behaviour? |
Hi @Amnell |
Hello @WilliamDenniss @julienbodet I am having the same issues as @dilee . I am unable to remove the cookies so that at the next login the login is a fresh one. It automatically logs in with the previous user instead. @Amnell would you be kind enough to share what you have working? Thanks. |
Hey @WilliamDenniss - curious if you had any status/timeline for this. Okta is getting a few requests a week for this functionality in https://github.com/okta/okta-sdk-appauth-ios We are trying to figure out if we can rely on this functionality in this library or if we need to circumvent and built it ourselves. Thanks for any updates! |
Hey @omgitstom, do you mean the timeline of when it gets merged into master? The main thing I was waiting for was confirmation that it actually works as I don't have a test server with an end-session endpoint myself. Looks like there's at least one bug which should be fixed by #285, but other than that it might be ready. Have you tried out this branch with Okta's end session endpoint? Does it work? Is there a public test instance I can try? I would encourage everyone who has tried this code against their own end session endpoints to post their results. If the code is demonstrated to work in an interoperable way, I'll get it merged. |
I've been using this in our Identity Server internal test environment along with @AndrewMcDrew's tweak in #285, my tweak in #312, and iOS 12 support from that branch added manually. So far it's been working as expected for me. |
45bb8c5
to
4635c48
Compare
@mattio, thanks for reporting back your results! I don't have any need for Logout myself, so I'm relying on y'all to test & validate the implementation here. Based on your comments, I merged those 2 PRs. I also rebased our dev branch onto master, for iOS 12 / Xcode 10 support. The old work pre-rebase is here if anyone needs macOS 32-bit support for some reason (NB, that tag is not supported at all, you'd be own your own there). Can everyone checkout the latest Once a few people independently confirm that this actually works for them, we can look at getting it merged. |
4635c48
to
eb0b4cd
Compare
@julienbodet rebased onto latest master (#393) |
Do you have a strong reference to the session object? I think this happens if the object gets deallocated. Please file a bug if you have a test case that can be repro'd |
I'm not quite following, Logout should use the same user-agent as login, should it not? At least, that is the intention. |
Can you file a separate issue for this one? It's getting too unwieldy to track so many issues in one thread. When you do, can you share the code snippit as well? |
Swift ambiguity is still there. Even login is broken in Swift on this branch.
|
Can you file a dedicated issue for this, and provide the sample code that generates the error? |
80ce826
to
914dd99
Compare
@WilliamDenniss tried to create a use-case for issue, but I can't reproduce this in new project or official example. Seems to be very rare issue which my project. |
Thanks for confirming. I was surprised by this error, as I would expect Swift to infer the type and therefore not have any ambiguity. Maybe you could explicitly declare the variable with the type? |
Well, I'm happy that enough people have tried this without problems. Merging soon. #YOLO |
914dd99
to
fa66e92
Compare
@WilliamDenniss any chance this will be merged and released soon? |
– Switched constructor to fieldMap pattern like the rest of AppAuth – Corrected indentation.
Fixed indentation.
…ynthesize the endSessionEndpoint property for consistency
Mirroring changes made in eb59c89.
fa66e92
to
ea5ad45
Compare
Merged. The |
@WilliamDenniss Any timing on an officially tagged release with logout functionality included? |
☝️ Is this available now? |
http://openid.net/specs/openid-connect-session-1_0.html#RPLogout
Implements #132. Fixes #258.