Skip to content

feat(auth): Added code flow support for OIDC flow. - #1220

Merged
xil222 merged 17 commits into
masterfrom
xinxinxin-codeflow
May 25, 2021
Merged

feat(auth): Added code flow support for OIDC flow.#1220
xil222 merged 17 commits into
masterfrom
xinxinxin-codeflow

Conversation

@xil222

@xil222xil222 commented Apr 6, 2021

Copy link
Copy Markdown
Contributor

RELEASE NOTE: Added code flow support for OIDC flow(previously only support idToken flow).
RELEASE NOTE: Defined OAuthResponseType for specifying responseType either idToken or code.
RELEASE NOTE: Defined two new error codes: INVALID_OAUTH_RESPONSETYPE and MISSING_OAUTH_CLIENT_SECRET.

@hiranya911hiranya911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. I mostly had nits. There might be couple of edge cases that need better handling and some tests.

Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadtest/unit/auth/auth-config.spec.ts Outdated
Comment threadtest/unit/auth/auth-config.spec.ts Outdated
Comment threadtest/unit/auth/auth-config.spec.ts

@hiranya911hiranya911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for making the changes. Looks pretty good. Just one last suggestion to cleanup the large loop in the implementation.

Comment threadsrc/auth/auth-config.ts Outdated
Comment threadtest/unit/auth/auth-config.spec.ts Outdated

@hiranya911hiranya911 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. LGTM 👍

Comment threadsrc/auth/auth-config.ts
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadsrc/auth/auth-config.ts
Comment threadsrc/auth/auth-config.ts
Comment threadsrc/auth/auth-config.ts Outdated
Comment threadtest/unit/auth/auth-config.spec.ts
Comment threadtest/unit/auth/auth-config.spec.ts

@bojeil-googlebojeil-google left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change looks good. Just 2 minor issues.

Comment threadsrc/auth/auth-config.ts Outdated
enabled: true,
clientId: 'CLIENT_ID',
issuer: 'https://oidc.com/issuer',
clientSecret: 'CLIENT_SECRET',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am concerned about legacy customers and would recommend keeping a test without clientSecret and responseType. Can you add new tests instead of modifying the existing ones?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I add tests for createOAuthIdpConfig and updateOAuthIdpConfig

@xil222
xil222 requested a review from egilmorezApril 27, 2021 23:32

@egilmorezegilmorez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One optional nit if it's not too big a PITA to regen the reference.

Thanks!

Comment threadsrc/auth/index.ts
/**
* The interface representing OIDC provider's response object for OAuth
* authorization flow.
* We need either of them to be true, there are two cases:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This comment could be improved. Suggest:

" * One of the following must be true:

  • If code is set to true, then we are doing code flow.
  • If dToken is set to true, then we are doing ID token flow."

(Assuming that backticks are rendered as code font, and that "ID token flow" is a thing, separate from the literal idToken flag.

Sign up for freeto 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.

6 participants

@xil222@Thaina@hiranya911@egilmorez@bojeil-google@lsirac