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

Authorization Code Flow for Single Page Applications: Authority and Protocol Classes #1133

Merged

Conversation

pkanher617
Copy link
Contributor

Please review PR #1109 before this one.

This PR adds authority and protocol-specific classes to the Authorization Code Flow library. Any changes to the account, IdToken, client info or authority classes should be incorporated in this PR. Most of these classes have been lifted from the implicit flow library, and should be thoroughly reviewed before merging.

}

constructor(rawClientInfo: string, crypto: ICrypto) {
if (!rawClientInfo || StringUtils.isEmpty(rawClientInfo)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

are there times there are empty client info and we want to construct the class?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe there are cases in B2C where we may not receive the client info object, but I will double check to verify. It would probably be a better pattern to throw a warning and not create the object at all, so I will make some changes to reflect that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, please re-review

Copy link
Member

Choose a reason for hiding this comment

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

Some cases of device flow had this issue but eSTS guarantees client_info and if it is empty, we need to raise a bug against them. However it may be necessary to confirm the expected behavior from msal js in case it returns empty.

lib/msal-common/src/auth/IdToken.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/IdToken.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/MsalAccount.ts Show resolved Hide resolved
lib/msal-common/src/error/ClientAuthError.ts Outdated Show resolved Hide resolved
lib/msal-common/src/url/IUri.ts Show resolved Hide resolved
Copy link
Contributor

@jasonnutter jasonnutter left a comment

Choose a reason for hiding this comment

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

Added some comments, will review later.

lib/msal-browser/src/utils/BrowserUtils.ts Show resolved Hide resolved
lib/msal-common/src/auth/ClientInfo.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/IdToken.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/IdToken.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/MsalAccount.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/MsalAccount.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/authority/AadAuthority.ts Outdated Show resolved Hide resolved
lib/msal-common/src/auth/authority/Authority.ts Outdated Show resolved Hide resolved
lib/msal-common/src/utils/Constants.ts Outdated Show resolved Hide resolved
@pkanher617 pkanher617 changed the base branch from authorization-code-flow-api to authorization-code-flow-base December 4, 2019 18:19
@pkanher617 pkanher617 merged commit dc8dc2e into authorization-code-flow-base Dec 5, 2019
@pkanher617 pkanher617 deleted the authorization-code-flow-auth-classes branch December 12, 2019 20:08
azure-pipelines bot pushed a commit to pkanher617/microsoft-authentication-library-for-js that referenced this pull request Jan 4, 2022
…auth-classes

Authorization Code Flow for Single Page Applications: Authority and Protocol Classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants