open-consul/ui/packages/consul-ui/app/components/auth-form
John Cowen 3d1b859533
ui: Support for SSO with Admin Partitions (#11604)
* Upgrade AuthForm and document current state a little better
* Hoist SSO out of the AuthForm
* Bare minimum admin partitioned SSO

also:

ui: Tabbed Login with Token or SSO interface (#11619)

- I upgraded our super old, almost the first ember component I wrote, to use glimmer/almost template only. This should use slots/contextual components somehow, but thats a bigger upgrade so I didn't go that far.
- I've been wanting to upgrade the shape of our StateChart component for a very long while now, here its very apparent that it would be much better to do this sooner rather than later. I left it as is for now, but there will be a PR coming soon with a slight reshaping of this component.
- Added a did-upsert modifier which is a mix of did-insert/did-update
- Documentation added/amended for all the new things.
2021-11-24 14:53:12 +00:00
..
README.mdx ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00
chart.xstate.js ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00
index.hbs ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00
index.js ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00
index.scss ui: Colocate remaining CSS components to the app/components folder (#10328) 2021-06-23 09:19:35 +01:00
layout.scss ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00
pageobject.js ui: Move to Workspaced Structure (#8994) 2020-10-21 15:23:16 +01:00
skin.scss ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00
tabs.xstate.js ui: Support for SSO with Admin Partitions (#11604) 2021-11-24 14:53:12 +00:00

README.mdx

# AuthForm

AuthForm is a mostly template only form component specifically for user
authentication for the UI. The component uses `TokenSource` which performs the
necessary functionality all composed together using a StateChart to
orchestrate the flow.

Errors are contained/rendered within the form itself.

```hbs preview-template
<AuthForm
  @dc={{'dc-1'}}
  @partition={{'default'}}
  @nspace={{'default'}}
  @onsubmit={{noop}}
as |api|></AuthForm>
```

## Arguments

| Argument | Type | Default | Description |
| --- | --- | --- | --- |
| `dc` | `String` | | The name of the current datacenter |
| `nspace` | `String` | | The name of the current namespace |
| `partition` | `String` | | The name of the current partition |
| `onsubmit` | `Function` |  | The action to fire when the form is submitted |

## Exported API

| Name | Type | Description |
| --- | --- | --- |
| `submit` | `Function` | Submit the form with a `{Name: 'oidc', Value: 'provider-name'}` which will eventually be passed as the `value` to the TokenSource |
| `focus` | `Function` | Focus the input field |
| `error` | `Function` | Fire an error to be displayed in the form |
| `reset` | `Function` | Reset the form back to its original empty/non-error state |
| `disabled` | `Boolean` | Whether the form is currently disabled or not |

## Slots

| Name | Description |
| --- | --- |
| `content` | Provides a configurable slot underneath the form for addition of other login widgets, in our case SSO |

## See

- [Component Source Code](./index.js)
- [Template Source Code](./index.hbs)

---