Skip to content

Picking up on @zachmargolis work, and fixing review comments - #191

Merged
WilliamDenniss merged 1 commit into
openid:dev-logoutfrom
luksfarris:farris-rp-initiated-logout
Feb 2, 2018
Merged

WilliamDenniss merged 1 commit into
openid:dev-logoutfrom
luksfarris:farris-rp-initiated-logout

Conversation

@luksfarris

@luksfarris luksfarris commented Jan 11, 2018 •

Copy link
Copy Markdown

From @zachmargolis:

These are the basic objects needed to support RP-initiated logout, I'd like to make sure they look ship-shape before adding methods to use them and follow up in another PR

I've picked his work, and fixed the comments made by @WilliamDenniss

Comment thread Source/OIDLogoutResponse.m Outdated
/*! @file OIDLogoutResponse.m
@brief AppAuth iOS SDK
@copyright
Copyright 2015 Google Inc. All Rights Reserved.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update all instances 2015 Google Inc. All Rights Reserved. -> 2017 The AppAuth Authors.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, thanks!

Comment thread Source/OIDLogoutResponse.h Outdated

/*! @brief Designated initializer.
@param request The serviced request.
@param parameters The decoded parameters returned from the Server.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what endpoint is this? rather than "from the Server" we should say "from the XYZ endpoint".

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, will rewrite soon!

@WilliamDenniss

Copy link
Copy Markdown
Member

Thanks for addressing the review comments from #138. I think this is nearly good to go, but I have a few questions:

1/
Can both you and @zachmargolis please sign the OpenID CLA to cover this contribution?

2/
Do you plan to implement the controllers for logout in addition to the model implemented here?

3/
I don't have much experience with the OpenID Connect Session Management draft. How stable is it in general? Do you have a working server implementation to test the client code against? Do you plan to use this client code in production?

@zachmargolis

Copy link
Copy Markdown

Re 1/: I signed. Thanks for picking this back up!

@luksfarris

Copy link
Copy Markdown
Author

Re 1/: signed as well. Thanks!

2/ I'm doing it right now. Will update the PR in several hours. I'll also rename everything from Logout to EndSession, to match the spec

3/ We are using okta's oidc, and they, in theory, support the end session flow. We plan to use it in production, as soon as we get it working. This pull request is interesting for us to have it available in the near future

@dgommers

Copy link
Copy Markdown

We are also in demand of this feature and I was about to test it with a Keycloak IDC instance. I tried to integrate the fork using Carthage. However, I discovered the newly added files are not attached to all the framework targets. This makes the new functionality unavailable for Carthage users.

To me it is unclear who should construct anOIDLogoutRequest instance and execute it. Could you elaborate on this? Right now it looks quite different from other request/response pairs, for example the OIDTokenRequest.

@codecov-io

codecov-io commented Jan 23, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #191 into dev-logout will increase coverage by 0.19%.
The diff coverage is 73.75%.

Impacted file tree graph

@@              Coverage Diff               @@
##           dev-logout     #191      +/-   ##
==============================================
+ Coverage       68.03%   68.23%   +0.19%     
==============================================
  Files              40       43       +3     
  Lines            3898     4039     +141     
  Branches           73       73              
==============================================
+ Hits             2652     2756     +104     
- Misses           1244     1281      +37     
  Partials            2        2
Impacted Files Coverage Δ
Source/OIDEndSessionResponse.m 0% <0%> (ø)
Source/OIDServiceDiscovery.m 93.95% <100%> (+0.08%) ⬆️
UnitTests/OIDEndSessionRequestTests.m 100% <100%> (ø)
UnitTests/OIDServiceDiscoveryTests.m 82.27% <100%> (+0.07%) ⬆️
Source/OIDEndSessionRequest.m 78.78% <78.78%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d27db29...527f6ec. Read the comment docs.

@luksfarris

luksfarris commented Jan 23, 2018 •

Copy link
Copy Markdown
Author

@dgommers I have updated the pull request adding the targets and fixing the Docs. I am currently renaming it from Logout to EndSession and adding a new class method called +performEndSessionRequest:(OIDendSessionRequest *)request completion:(OIDEndSessionCompletion)completion to class OIDAuthorizationService. Do you have a better suggestion of where it should be?

EDIT: contrary to my initial thoughts, the End Session API should be presented to the user in a web page, so the OP should (according to the spec) ask if the end-user whether he wants to logout. IF the user, in the web page says YES, the webpage is redirected to the logout callback parameter that is already implemented. This flow is possible by using OIDSafariViewControllerFactory like is already being done in this SDK. My plan is to provide a similar experience

EDIT2: after further investigation, this looks like it will need a similar protocol to OIDAuthorizationFlowSession, and a class method in OIDAuthState like what we have for authStateByPresentingAuthorizationRequest:presentingViewController:callback:

@WilliamDenniss

Copy link
Copy Markdown
Member

Thanks for signing the CLA all!

EDIT2: after further investigation, this looks like it will need a similar protocol to OIDAuthorizationFlowSession, and a class method in OIDAuthState like what we have for authStateByPresentingAuthorizationRequest:presentingViewController:callback:

Yes, you're right.

Previously there was only one place a user-agent (browser / SFAuthenticationSession) was used, now there will be multiple. So whatever way you implement this, the one thing I'm definitely going to be looking for is having the "open URL in user agent / callback" part reused in both cases – I hope there's a good way to generalize that code.

Regarding when we integrate this into master, I think it makes sense to merge this feature into master only when it's usable (models + controller). Do you want a mega PR with the models + controller, OR, we could merge this into a development branch so you can start a new PR with the controller. A development branch still enables people to test it via Carthage/CocoaPods if they specify the branch so that could be useful.

@dgommers

Copy link
Copy Markdown

Got it, thanks. Good to hear that logic can be shared with the OIDAuthorizationFlowSession.

Suggestion: A separate protocol for such resumeAuthorizationFlowWithURL: flows would help to keep the AppDelegate code clean. Implemented by both OIDAuthorizationFlowSession and the end session flow class.

Let me know if I can be of any help. I am keeping an eye on this thread.

@luksfarris
luksfarris force-pushed the farris-rp-initiated-logout branch from 0768aab to 47d8460 Compare January 24, 2018 10:44
@luksfarris

luksfarris commented Jan 24, 2018 •

Copy link
Copy Markdown
Author

I agree with you William, it makes a lot of sense to split this into 2 pull requests. I've renamed the request/response/test classes, and squashed the 3 commits. I'll start working on the other PR right away.
Thanks for the support!

EDIT: I forgot to update the framework headers. Updating PR now

@luksfarris

Copy link
Copy Markdown
Author

I've created issue #195 and PR #196 to address the necessary architecture changes for us to create the RP-Initiated logout controller

@luksfarris
luksfarris force-pushed the farris-rp-initiated-logout branch from ecb6535 to e50f457 Compare January 24, 2018 16:37
@WilliamDenniss

Copy link
Copy Markdown
Member

OK, are you ready for me to merge this into a development branch for logout?

@luksfarris

luksfarris commented Jan 25, 2018 •

Copy link
Copy Markdown
Author

Yes we are! But the PR is set to merge to the master branch, and I don't see any development branches in the repository, let me know if I need to create this branch and update the PR

@WilliamDenniss

WilliamDenniss commented Jan 25, 2018 •

Copy link
Copy Markdown
Member

I created "dev-logout" can you point the PR at that?

Also can you reword your commit message to describe the actual changes that are going in? Feel free to credit Zach in the body of the message, but I think the first line should focus on the code changes.

#196 can go direct to master, but the rest we can merge into dev-logout until it's complete.

@luksfarris
luksfarris changed the base branch from master to dev-logout January 26, 2018 11:52
@luksfarris
luksfarris force-pushed the farris-rp-initiated-logout branch from e50f457 to 527f6ec Compare January 26, 2018 11:56
@luksfarris

Copy link
Copy Markdown
Author

Done, and done!

Comment thread Source/AppAuth.h
#import "OIDTokenResponse.h"
#import "OIDTokenUtilities.h"
#import "OIDURLSessionProvider.h"
#import "OIDEndSessionRequest.h"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imports should be in alphabetical order, can you address in a subsequent commit? Here and the framework header.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will! Thanks William

@WilliamDenniss
WilliamDenniss merged commit 0c59e4b into openid:dev-logout Feb 2, 2018
@jaishankar

jaishankar commented Feb 21, 2018 •

Copy link
Copy Markdown

@luksfarris @WilliamDenniss Thanks for this logout feature, my understanding is that, after the PR 196 is done, there is going to a new class method (say. authStateByPresentingEndSessionEndpointRequest) in OIDAuthState which returns the callback with EndSessionEndpointResponse. Is this correct or can you clarify on how the SFAuthenticationSession / browser be invoked for the logout flow?
cc @dgommers

@luksfarris

Copy link
Copy Markdown
Author

@jaishankar with the other pull request you saw, we'd have the ability to create non authentication external user agent requests. This allows us to create a new Logout FlowSession, and have it called in a class method in OIDAuthState.

How the browser will be invoked, is an open question. SFAuthenticationSession has a terrible user experience, because every time you open it, it asks for a "Sign In" confirmation (therefore our plan of "generic" requests looks and feels weird. With @WilliamDenniss 's implementation of external browsers, we now have other possibilities

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants