-
Notifications
You must be signed in to change notification settings - Fork 836
Add support for dynamic client registration. #22
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
Conversation
|
+@StevenEWright and +@WilliamDenniss for review
|
|
Any update on this? |
|
Reviewed 3 of 28 files at r1. Example/Source/AppAuthExampleViewController.m, line 182 [r2] (raw file):
Nit... (sorry, my job! LOL) https://google.github.io/styleguide/objcguide.xml?showone=Container_Literals#Container_Literals "If the collection fits on one line, put a single space after the opening and before the closing brackets." @[ redirectURI ] Example/Source/AppAuthExampleViewController.m, line 184 [r2] (raw file):
Nit... please one parameter per line, or all on one line. Example/Source/AppAuthExampleViewController.m, line 193 [r2] (raw file):
Block contents need only 2 spaces indent from "callback" Example/Source/AppAuthExampleViewController.m, line 194 [r2] (raw file):
Only 2 spaces indent from start of "if" Example/Source/AppAuthExampleViewController.m, line 236 [r2] (raw file):
Only 2 spaces from left. Example/Source/AppAuthExampleViewController.m, line 239 [r2] (raw file):
Only +2 spaces from left. Example/Source/AppAuthExampleViewController.m, line 240 [r2] (raw file):
Line continuations only +4 spaces. Example/Source/AppAuthExampleViewController.m, line 276 [r2] (raw file):
Unnecessary blank line after start of block. Example/Source/AppAuthExampleViewController.m, line 290 [r2] (raw file):
Only +2 spaces from "if" alignment. Example/Source/AppAuthExampleViewController.m, line 313 [r2] (raw file):
Indentation seems consistently mixed between using 4 and 2 spaces for indentation. I'm going to stop here for now and let you address. Comments from Reviewable |
|
Example/Source/AppAuthExampleViewController.m, line 313 [r2] (raw file):
|
Current coverage is 76.22% (diff: 75.67%)@@ master #22 diff @@
==========================================
Files 33 39 +6
Lines 1957 2355 +398
Methods 386 448 +62
Messages 0 0
Branches 101 123 +22
==========================================
+ Hits 1491 1795 +304
- Misses 424 503 +79
- Partials 42 57 +15
|
|
Reviewed 1 of 28 files at r1, 25 of 27 files at r3. Source/AppAuth.h, line 31 at r3 (raw file):
is Source/OIDAuthorizationService.h, line 69 at r3 (raw file):
Source/OIDAuthorizationService.h, line 135 at r3 (raw file):
sorry to be a pain, but can we call this Source/OIDAuthorizationService.m, line 366 at r3 (raw file):
can you set Xcode to strip trailing spaces? Source/OIDAuthorizationService.m, line 413 at r3 (raw file):
this looks like it could fit on the previous line, but if not should be indented +4. Here and elsewhere Source/OIDAuthorizationService.m, line 424 at r3 (raw file):
indent +4 Source/OIDAuthorizationService.m, line 437 at r3 (raw file):
indent Source/OIDAuthorizationService.m, line 442 at r3 (raw file):
and here Source/OIDAuthState.m, line 192 at r3 (raw file):
I don't see this in the header as the new designated initializer. Source/OIDAuthState.m, line 206 at r3 (raw file):
since this clears the auth state, shouldn't it be first? Source/OIDClientMetadataParameters.h, line 31 at r3 (raw file):
doxygen comments are out of sync throughout Source/OIDClientMetadataParameters.m, line 1 at r3 (raw file):
What's the design behind this file? I see in the Response class the consts are defined there instead. Are these shared? For AuthorizationRequest we don't even expose the param consts are part of the API (they exist only in the .m) Source/OIDFieldMapping.m, line 117 at r3 (raw file):
no space before 'value' Source/OIDRegistrationRequest.h, line 98 at r3 (raw file): Source/OIDRegistrationRequest.m, line 31 at r3 (raw file):
For AuthorizationRequest we re-used the OAuth param names for serialization and building the URL. If you did that here would it mean you wouldn't need the MetadataParameters file? Source/OIDRegistrationRequest.m, line 81 at r3 (raw file):
indent Source/OIDRegistrationRequest.m, line 117 at r3 (raw file):
indent if it can't fit on the previous line with colon alignment Source/OIDRegistrationRequest.m, line 122 at r3 (raw file):
same Source/OIDRegistrationRequest.m, line 129 at r3 (raw file): indent this line +4 from the "self", and then align the colons on that Source/OIDRegistrationRequest.m, line 136 at r3 (raw file):
I think this can fit on one line, here and throughout this method Source/OIDRegistrationRequest.m, line 157 at r3 (raw file):
indent Source/OIDRegistrationRequest.m, line 176 at r3 (raw file):
indent Source/OIDRegistrationResponse.m, line 96 at r3 (raw file):
indentation is correct, but move the OR operator to the second line Source/OIDRegistrationResponse.m, line 97 at r3 (raw file):
use // style comments in the method, even for a long comment Source/OIDServiceConfiguration.h, line 65 at r3 (raw file):
to avoid a breaking change, can this be an additional constructor? Source/OIDServiceConfiguration.m, line 47 at r3 (raw file):
indent 4 spaces and align columns on this line Source/OIDTokenResponse.m, line 76 at r3 (raw file):
nice! UnitTests/OIDRegistrationRequestTests.m, line 62 at r3 (raw file):
move to next line and +4. Then either line colons up to that line, or +4 indent the longest and line up on that one instead. UnitTests/OIDRegistrationRequestTests.m, line 161 at r3 (raw file):
extra linebreak UnitTests/OIDRegistrationResponseTests.m, line 67 at r3 (raw file):
first param can go on the previous line ( Comments from Reviewable |
|
Review status: 12 of 26 files reviewed at latest revision, 39 unresolved discussions. Source/AppAuth.h, line 31 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> is `OIDClientMetadataParameters.h` intentionally not included? OK if it is, just checking.Source/OIDAuthorizationService.h, line 69 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> > N > Align with the start of the first param (i.e. indent 4 more spaces)Source/OIDAuthorizationService.h, line 135 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> > callback: > > sorry to be a pain, but can we call this `completion` and `OIDRegistrationCompletion`? I've realized that 'callback' is very generic and doesn't really help understanding, I know that's what we used elsewhere. >Source/OIDAuthorizationService.m, line 366 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> can you set Xcode to strip trailing spaces?Source/OIDAuthorizationService.m, line 413 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> this looks like it could fit on the previous line, but if not should be indented +4. Here and elsewhereSource/OIDAuthorizationService.m, line 424 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indent +4Source/OIDAuthorizationService.m, line 437 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indentSource/OIDAuthorizationService.m, line 442 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> and hereSource/OIDAuthState.m, line 192 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> I don't see this in the header as the new designated initializer.Source/OIDAuthState.m, line 206 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> since this clears the auth state, shouldn't it be first?Source/OIDClientMetadataParameters.h, line 31 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> doxygen comments are out of sync throughoutSource/OIDClientMetadataParameters.m, line 1 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> What's the design behind this file? I see in the Response class the consts are defined there instead. Are these shared? For AuthorizationRequest we don't even expose the param consts are part of the API (they exist only in the .m)In addition the response will contain the metadata the OP issues ( The thought was to encapsulate all relevant client metadata parameters in I think this design allows for greater flexibility in the case there are more parameters to come that should be explicitly handled by the SDK. Otherwise the parameter name would have to be duplicated in both the response and request class each time. Source/OIDFieldMapping.m, line 117 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> no space before 'value' `(NSNumber *)value`Source/OIDRegistrationRequest.h, line 98 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> >Source/OIDRegistrationRequest.m, line 31 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> > OIDSubjectTypeParam > > For AuthorizationRequest we re-used the OAuth param names for serialization and building the URL. If you did that here would it mean you wouldn't need the MetadataParameters file?Source/OIDRegistrationRequest.m, line 81 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indentSource/OIDRegistrationRequest.m, line 117 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indent if it can't fit on the previous line with colon alignmentSource/OIDRegistrationRequest.m, line 122 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> sameSource/OIDRegistrationRequest.m, line 129 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> > > indent this line +4 from the "self", and then align the colons on thatSource/OIDRegistrationRequest.m, line 136 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> I think this can fit on one line, here and throughout this methodSource/OIDRegistrationRequest.m, line 157 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indentSource/OIDRegistrationRequest.m, line 176 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indentSource/OIDRegistrationResponse.m, line 96 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indentation is correct, but move the OR operator to the second lineSource/OIDRegistrationResponse.m, line 97 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> use // style comments in the method, even for a long commentSource/OIDServiceConfiguration.h, line 65 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> to avoid a breaking change, can this be an additional constructor?Source/OIDServiceConfiguration.m, line 47 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> indent 4 spaces and align columns on this lineUnitTests/OIDRegistrationRequestTests.m, line 62 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> move to next line and +4. Then either line colons up to that line, or +4 indent the longest and line up on that one instead.UnitTests/OIDRegistrationRequestTests.m, line 161 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> extra linebreakUnitTests/OIDRegistrationResponseTests.m, line 67 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> first param can go on the previous line (`@{ OIDClient…`), then line up as you have. here and belowComments from Reviewable |
|
Review status: 12 of 26 files reviewed at latest revision, 20 unresolved discussions, some commit checks failed. Example/Source/AppAuthExampleViewController.m, line 276 at r2 (raw file): Previously, StevenEWright (Steven E Wright) wrote…> Unnecessary blank line after start of block.Source/AppAuth.h, line 31 at r3 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…> Yep, I didn't think there was any reason to expose since it only contains OIDC parameters automagically handled by the SDK.Source/OIDAuthorizationService.h, line 135 at r3 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…> Done. However, this should be followed by the same change for the other methods in `OIDAuthorizationService` (for example`OIDDiscoveryCallback`, `OIDAuthorizationCallback`, `OIDTokenCallback`, `presentAuthorizationRequest:[...]:callback`, `performTokenRequest:[...]:callback`, etc), for a consistent API.Source/OIDAuthorizationService.m, line 438 at r4 (raw file):
Can we strip all these trailing spaces? Sorry to be a pain but our tools (and Reviewable) always points them out. Source/OIDAuthState.m, line 192 at r3 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…> It is not exposed at all in the header by design. I think it is better if `AuthState` is initiated from the registration response only since you would probably *not* have an authorization response together with the registration response. The authorization response can be added later with `updateWithAuthorizationResponse`. I am however open to exposing this initializer in the header, but even then maybe not as the designated initializer?That said, I don't really think it's a problem to just expose it. Maybe I am sitting on those three objects due to some out of band request processing, and just want to create an AuthState at that moment. My vote would be to expose. Source/OIDAuthState.m, line 439 at r4 (raw file):
can you rebase on origin/master to avoid these changes appearing here? Source/OIDClientMetadataParameters.h, line 31 at r3 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…> Out of sync how?Source/OIDClientMetadataParameters.m, line 1 at r3 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…> All client metadata registered by the OP from the registration request should be echoed back to the client in the registration response, hence the response will (in most) cases contain all the parameters present in the request. So those are shared. > > In addition the response will contain the metadata the OP issues (`client_id`, `client_secret`, etc.), which is why those parameters are only defined in the `RegistrationResponse.m` (they are exposed through the interface of that class). > > The thought was to encapsulate all relevant client metadata parameters in `OIDClientMetadataParameters.h` to be able to share them between the request and the response. However, right now the only parameter explicitly handled is the `token_endpoint_auth_method` (in anticipation of the token endpoint client auth changeset). > (And this is also the reason why this header is not exposed through `AppAuth.h`, it probably isn't too useful for an user of the SDK.) > > I think this design allows for greater flexibility in the case there are more parameters to come that should be explicitly handled by the SDK. Otherwise the parameter name would have to be duplicated in both the response and request class each time. >Source/OIDRegistrationRequest.m, line 31 at r3 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…> Unfortunately not. As expanded above `MetadataParameters` is necessary due to the coupling between registration request and response. I have however changed the values to match the OAuth param names for consistency.UnitTests/OIDRegistrationRequestTests.m, line 161 at r4 (raw file):
trailing spaces here and elsewhere UnitTests/OIDRegistrationResponseTests.m, line 67 at r4 (raw file):
Align the 'O' with same on previous line Comments from Reviewable |
|
Review status: 6 of 26 files reviewed at latest revision, 15 unresolved discussions. Example/Source/AppAuthExampleViewController.m, line 276 at r2 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> please fixSource/OIDAuthorizationService.m, line 438 at r4 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> Can we strip all these trailing spaces? Sorry to be a pain but our tools (and Reviewable) always points them out.Source/OIDAuthState.m, line 192 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> hmm ok but this is the designated initializer right? You can declare it privately in the .m like this class does: https://github.com/openid/AppAuth-iOS/blob/master/Source/OIDServiceConfiguration.m#L44 > > That said, I don't really think it's a problem to just expose it. Maybe I am sitting on those three objects due to some out of band request processing, and just want to create an AuthState at that moment. My vote would be to expose.Source/OIDAuthState.m, line 439 at r4 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> can you rebase on origin/master to avoid these changes appearing here?Source/OIDClientMetadataParameters.h, line 31 at r3 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> My mistakeUnitTests/OIDRegistrationResponseTests.m, line 67 at r4 (raw file): Previously, WilliamDenniss (William Denniss) wrote…> Align the 'O' with same on previous lineComments from Reviewable |
|
Bitrise is reporting the following failures: |
|
Reviewed 4 of 14 files at r4, 19 of 19 files at r5. Source/OIDAuthState.m, line 439 at r4 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…
OK, I think Readable is including it then. Source/OIDRegistrationRequest.h, line 97 at r5 (raw file):
The param is the spec is UnitTests/OIDRegistrationResponseTests.m, line 67 at r4 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…
Sorry to be unclear, but this is what I was expecting: Comments from Reviewable |
|
Reviewed 1 of 27 files at r3. Example/Source/AppAuthExampleViewController.m, line 182 at r2 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
LGTM Example/Source/AppAuthExampleViewController.m, line 184 at r2 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
LGTM Example/Source/AppAuthExampleViewController.m, line 193 at r2 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
LGTM Example/Source/AppAuthExampleViewController.m, line 194 at r2 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
LGTM Example/Source/AppAuthExampleViewController.m, line 236 at r2 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
LGTM Example/Source/AppAuthExampleViewController.m, line 201 at r5 (raw file):
Something seems wrong here with the client ID parameter name? Source/OIDAuthorizationService.m, line 397 at r5 (raw file):
Plz CAP all acronyms & initialisms. (json --> JSON) NSError *JSONDeserializationError; Source/OIDAuthorizationService.m, line 399 at r5 (raw file):
Indent line continuation +4 sp. Source/OIDAuthorizationService.m, line 425 at r5 (raw file):
Same JSON comments. Source/OIDAuthState.h, line 153 at r5 (raw file):
response -> registrationResponse Source/OIDAuthState.h, line 159 at r5 (raw file):
response -> authorizationResponse Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. Example/Source/AppAuthExampleViewController.m, line 201 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
What do you mean? Source/OIDAuthorizationService.m, line 397 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
This was actually copied straight from Source/OIDAuthorizationService.m, line 399 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
Done. Source/OIDAuthorizationService.m, line 425 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
Will change when above comment is resolved. Source/OIDAuthState.h, line 153 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
Done. Source/OIDAuthState.h, line 159 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
Done. Source/OIDRegistrationRequest.h, line 97 at r5 (raw file): Previously, WilliamDenniss (William Denniss) wrote…
You're correct, so this (unintentional) change was for the better! UnitTests/OIDRegistrationResponseTests.m, line 67 at r4 (raw file): Previously, WilliamDenniss (William Denniss) wrote…
Ok, I understand. But this will give lines that are too long in all cases but one. So I opted to revert to the original avoid inconsistent indentation. Comments from Reviewable |
|
There was a parameter name mismatch. Hopefully resolved now (I can't view the Bitrise results). Comments from Reviewable |
|
Review status: 23 of 26 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. Example/Source/AppAuthExampleViewController.m, line 201 at r5 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…
Please look carefully at the method signature:
There is no parameter name for the clientID parameter. Comments from Reviewable |
|
Review status: 23 of 26 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. Source/OIDAuthorizationService.m, line 397 at r5 (raw file): Previously, rebeckag (Rebecka Gulliksson) wrote…
Fine by me. Looks like there are several such issues in the codebase now. I can put together a PR To fix all of them as a follow up. @WilliamDenniss ? Comments from Reviewable |
|
Review status: 23 of 26 files reviewed at latest revision, 8 unresolved discussions, some commit checks failed. Example/Source/AppAuthExampleViewController.m, line 201 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
Done. Comments from Reviewable |
|
Reviewed 4 of 4 files at r6. Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Source/OIDAuthorizationService.m, line 397 at r5 (raw file): Previously, StevenEWright (Steven E Wright) wrote…
SGTM Source/OIDError.m, line 27 at r6 (raw file):
Need to add this to isOAuthErrorDomain WilliamDenniss@1c60fcc#diff-2dd226962951829f45ccdfd986b28602L40 Comments from Reviewable |
|
It's unfortunately that you can't view Bitrise, but I was able to get the same errors by building and running the tests manually from XCode. Here are the errors: Here's a patch to fix those errors, and correct another issue with how dynamic registration errors are parsed: |
|
Is there a test server instance to try this out on? I tried a node.js one (forked to work with AppAuth) https://github.com/WilliamDenniss/node-oidc-provider. The registration works, but token exchange doesn't as they require the client secret in a header which I believe #24 will address. I'm keen to try a full end-to-end test. |
Not that I know of. Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks failed. Source/OIDError.m, line 27 at r6 (raw file): Previously, WilliamDenniss (William Denniss) wrote…
Done. Comments from Reviewable |
|
@panva fixed https://github.com/panva/node-oidc-provider following my feedback, so now it can be used! To enable native app support in node-oidc-provider, With that, I was able to test this PR end-to-end. Yey! |
Add support for dynamic client registration.
Add support for dynamic client registration.
Add support for dynamic client registration.
|
LGTM I rebased this, and merged. Added client secrets to the sample so it would work with dynamic registration in my end-to-end test. |
(Sorry for the large changeset.)
Similar implementation to the one for Android:
This change is