README.mdx
1---
2class: ember
3---
4## TokenSource
5
6```hbs
7 <TokenSource
8 @dc={{dc}}
9 @nspace={{nspace}}
10 @type={{or 'oidc' 'secret'}}
11 @value={{or identifierForProvider secret}}
12 @onchange={{action 'change'}}
13 @onerror={{action 'error'}}
14 />
15```
16
17### Arguments
18
19| Argument | Type | Default | Description |
20| --- | --- | --- | --- |
21| `dc` | `String` | | The name of the current datacenter |
22| `nspace` | `String` | | The name of the current namespace |
23| `onchange` | `Function` | | The action to fire when the data changes. Emits an Event-like object with a `data` property containing the jwt data, in this case the autorizationCode and the status |
24| `onerror` | `Function` | | The action to fire when an error occurs. Emits ErrorEvent object with an `error` property containing the Error. |
25
26This component will go through the steps of requesting a JWT token from a third party oauth provider. `src` should contain the full URL of the authorization URL for the 3rd party provider. Once the user has logged into the 3rd party provider the `onchange` event will be fired containing an event-like object whose data contains the JWT information.
27
28The component need only be place into the DOM in order to begin the OAuth dance.
29
30### See
31
32- [Component Source Code](./index.js)
33- [Template Source Code](./index.hbs)
34
35---
36