-
Notifications
You must be signed in to change notification settings - Fork 406
feat(auth): Added code flow support for OIDC flow. #1220
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
Changes from 2 commits
d6681cc
3a925a5
4f2e7bc
3aacc80
4b86338
e565db3
0a36501
92202e6
01f0c34
14034d2
4fb8597
82ea5bb
b87a4ce
5dd52df
0a0cd0d
e824a41
2db147e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3503,12 +3503,20 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => { | |
| enabled: true, | ||
| clientId: 'CLIENT_ID', | ||
| issuer: 'https://oidc.com/issuer', | ||
| clientSecret: 'CLIENT_SECRET', | ||
|
||
| responseType: { | ||
| code: true, | ||
| }, | ||
| }; | ||
| const expectedRequest = { | ||
| displayName: 'OIDC_DISPLAY_NAME', | ||
| enabled: true, | ||
| clientId: 'CLIENT_ID', | ||
| issuer: 'https://oidc.com/issuer', | ||
| clientSecret: 'CLIENT_SECRET', | ||
| responseType: { | ||
| code: true, | ||
| }, | ||
| }; | ||
| const expectedResult = utils.responseFrom(deepExtend({ | ||
| name: `projects/project1/oauthIdpConfigs/${providerId}`, | ||
|
|
@@ -3594,12 +3602,20 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => { | |
| enabled: true, | ||
| clientId: 'CLIENT_ID', | ||
| issuer: 'https://oidc.com/issuer', | ||
| clientSecret: 'CLIENT_SECRET', | ||
| responseType: { | ||
| code: true, | ||
| }, | ||
| }; | ||
| const expectedRequest = { | ||
| displayName: 'OIDC_DISPLAY_NAME', | ||
| enabled: true, | ||
| clientId: 'CLIENT_ID', | ||
| issuer: 'https://oidc.com/issuer', | ||
| clientSecret: 'CLIENT_SECRET', | ||
| responseType: { | ||
| code: true, | ||
| }, | ||
| }; | ||
| const expectedResult = utils.responseFrom(deepExtend({ | ||
| name: `projects/project_id/oauthIdpConfigs/${providerId}`, | ||
|
|
@@ -3611,10 +3627,14 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => { | |
| enabled: false, | ||
| clientId: 'NEW_CLIENT_ID', | ||
| issuer: 'https://oidc.com/issuer2', | ||
| clientSecret: 'CLIENT_SECRET', | ||
| responseType: { | ||
| code: true, | ||
| }, | ||
| })); | ||
|
|
||
| it('should be fulfilled given full parameters', () => { | ||
| const expectedPath = path + '?updateMask=enabled,displayName,issuer,clientId'; | ||
| const expectedPath = path + '?updateMask=enabled,displayName,issuer,clientId,clientSecret,responseType.code'; | ||
| const stub = sinon.stub(HttpClient.prototype, 'send').resolves(expectedResult); | ||
| stubs.push(stub); | ||
|
|
||
|
|
@@ -3708,7 +3728,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => { | |
| }); | ||
|
|
||
| it('should be rejected when the backend returns a response missing name', () => { | ||
| const expectedPath = path + '?updateMask=enabled,displayName,issuer,clientId'; | ||
| const expectedPath = path + '?updateMask=enabled,displayName,issuer,clientId,clientSecret,responseType.code'; | ||
| const expectedError = new FirebaseAuthError( | ||
| AuthClientErrorCode.INTERNAL_ERROR, | ||
| 'INTERNAL ASSERT FAILED: Unable to update OIDC configuration', | ||
|
|
@@ -3728,7 +3748,7 @@ AUTH_REQUEST_HANDLER_TESTS.forEach((handler) => { | |
| }); | ||
|
|
||
| it('should be rejected when the backend returns an error', () => { | ||
| const expectedPath = path + '?updateMask=enabled,displayName,issuer,clientId'; | ||
| const expectedPath = path + '?updateMask=enabled,displayName,issuer,clientId,clientSecret,responseType.code'; | ||
| const expectedServerError = utils.errorFrom({ | ||
| error: { | ||
| message: 'INVALID_CONFIG', | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.