Skip to content
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

Defining interfaces #3

Merged
merged 14 commits into from
Oct 10, 2016
Merged

Defining interfaces #3

merged 14 commits into from
Oct 10, 2016

Conversation

rayluo
Copy link
Collaborator

@rayluo rayluo commented Sep 22, 2016

This PR is created to facilitate the discussion on current API interface. The functional implementation is not completed and not intended to be merged as-is.

@rayluo rayluo self-assigned this Sep 22, 2016
@rayluo rayluo force-pushed the defining-interfaces branch 3 times, most recently from d5f4b2a to b6465ff Compare September 23, 2016 02:22
Copy link
Collaborator Author

@rayluo rayluo left a comment

Choose a reason for hiding this comment

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

Document the outcome of the Code Review meeting.

(Under the hood, we simply merge scope and additional_scope before
sending them on the wire.)
"""
a = Authority(self.authority, policy=policy) # TODO
Copy link
Collaborator Author

@rayluo rayluo Sep 23, 2016

Choose a reason for hiding this comment

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

  1. Remove the policy from Authority constructor.
  2. When writing a comment with "TODO", please also provide a summary about what needs to be done later, before you forget them.

def get_authorization_request_url(
self,
scope,
# additional_scope=None,
Copy link
Collaborator Author

@rayluo rayluo Sep 23, 2016

Choose a reason for hiding this comment

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

We choose to provide both scope and optional additional_scope as a way to remind the developers the conceptual difference. In practice, the developer can still choose to use scope only, if they prefer.

# before sending them on the wire. So there is no practical
# difference than removing this parameter and using scope only.
login_hint=None,
state=None, # TBD: It is not in MSAL-dotnet nor MSAL-Android,
Copy link
Collaborator Author

@rayluo rayluo Sep 23, 2016

Choose a reason for hiding this comment

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

Keep it here. All other MSAL libraries shall also add this parameter.

self,
code, # TBD:
# .NET 's protected method defines 2 parameters: code, scope.
# .NET 's public method defines 2 parameters: scope, code.
Copy link
Collaborator Author

@rayluo rayluo Sep 23, 2016

Choose a reason for hiding this comment

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

Keep code as the first parameter. Remind MSAL-dotnet to do so too.

code, # TBD:
# .NET 's protected method defines 2 parameters: code, scope.
# .NET 's public method defines 2 parameters: scope, code.
scope, # TBD: This could be optional. Shall it? See the document below.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Keep it as a required parameter

# .NET 's public method defines 2 parameters: scope, code.
scope, # TBD: This could be optional. Shall it? See the document below.
redirect_uri=None,
# TBD: It is not in MSAL-dotnet. Do we need it? OAuth2 RFC says:
Copy link
Collaborator Author

@rayluo rayluo Sep 23, 2016

Choose a reason for hiding this comment

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

Remind dotnet implementation to add an overload method for redirect_uri too.

# If absent, STS will give you a token associated to ONE of the scope
# sent in the authorization request. So only omit this when you are
# working with only one scope.
scope = scope or ["openid", "email", "profile", "offline_access"] # TBD
Copy link
Collaborator Author

@rayluo rayluo Sep 23, 2016

Choose a reason for hiding this comment

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

Only when the developer pass a single "client_id" as scope, then we change it into the predefined 4.

"client_id" -> ["openid", "email", "profile", "offline_access"]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed in this commit

):
# It will handle the TWO round trips of Authorization Code Grant flow.
raise NotImplemented()

Copy link
Collaborator Author

@rayluo rayluo Sep 23, 2016

Choose a reason for hiding this comment

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

Incline to add 2 more methods for device code grant here, rather than creating a dedicated sub class DeviceCodeClient.

@rayluo rayluo force-pushed the defining-interfaces branch from b6465ff to 7ead4a3 Compare September 28, 2016 22:31
@rayluo rayluo merged commit bab4d16 into dev Oct 10, 2016
@rayluo rayluo deleted the defining-interfaces branch November 30, 2018 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant