Skip to content
This repository has been archived by the owner on Jan 26, 2025. It is now read-only.

🌱 Make responseType configurable #143

Merged
merged 3 commits into from
Mar 15, 2018

Conversation

jmelberg-okta
Copy link
Contributor

@jmelberg-okta jmelberg-okta commented Mar 9, 2018

Description

Allows the OAuth 2.0 response_type to be configurable for implicit flows.

Important: code isn't explicitly supported yet.

Resolves: #109

@@ -48,7 +48,7 @@ const appRoutes: Routes = [
},
{
path: 'sessionToken-login',
component: SessionTokenLogin
component: SessionTokenLoginComponent
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is used only in our test suite. We aren't exposing any of this via our SDK, so we aren't introducing a breaking change.

OktaLoginRedirectComponent
} from '@okta/okta-angular';

describe('Unit Tests', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

These spec files should be siblings of the source files, it's odd that we're burying unit testing within an e2e test. We should discuss this, we need to decide if we're going to fix this now or later. I also need a place to put unit testing for the user agent work

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed offline: this is going to be significant work and duplication of test boilerplate, so we won't do this.

@@ -18,6 +18,7 @@ export interface OktaConfig {
clientId?: string;
scope?: string;
onAuthRequired?: Function;
responseType?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should get some README love

Copy link
Contributor

@robertjd robertjd left a comment

Choose a reason for hiding this comment

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

Readme comment, otherwise LGTM

expect(component).toBeTruthy();
}));

it('should instantiate the OktaAuth object', async(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

We really should be testing that we correctly pass this down to the AuthJS constructor on the login redirect. To do so we would need to write a provider (or service?) wrapper around AuthJS so that it can easily be mocked via DI in test and observed. Out of scope for this PR, since we'll have to touch a lot of code with that change.

@@ -37,6 +37,7 @@ The `OktaAuthModule` is the initializer for your OpenID Connect client configura
- `clientId` **(required)**: The OpenID Connect `client_id`
- `redirectUri` **(required)**: Where the callback is hosted
- `scope` *(optional)*: Reserved for custom claims to be returned in the tokens
- `responseType` *(optional)*: Desired token grant types
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like we should be explicitly mentioning that these are string values.

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 thought about noting that in this section, but seems weird to only mention the types on this configuration value. When this value is evaluated, typescript will error due to a type difference.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aw, types 💘

@jmelberg-okta jmelberg-okta merged commit 644d448 into 1.0.0-angular Mar 15, 2018
@jmelberg-okta jmelberg-okta deleted the jm-update-responseType branch March 15, 2018 22:40
robertjd pushed a commit that referenced this pull request Mar 19, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master
robertdamphousse-okta pushed a commit that referenced this pull request Mar 19, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Add lniter to test in vue
jmelberg-okta pushed a commit that referenced this pull request Mar 19, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Add lniter to test in vue
jmelberg-okta pushed a commit that referenced this pull request Mar 20, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Add lniter to test in vue
jmelberg-okta pushed a commit that referenced this pull request Mar 20, 2018
Uses the new property in AuthJS to append the framework lib to the user agent

Also adds unit testing via Jest for React, Vue

Angular not yet tested, will add a "unit" test to app.component.spec.ts after #143 lands in master

Add lniter to test in vue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants