-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: Improve dev-time SSO/OIDC visibility
- Loading branch information
John Cowen
committed
Oct 8, 2021
1 parent
baa377d
commit a164567
Showing
12 changed files
with
107 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
ui/packages/consul-ui/app/templates/oauth-provider-debug.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Route | ||
@name={{routeName}} | ||
as |route|> | ||
<div | ||
style="width: 50%;margin: 0 auto;" | ||
> | ||
<h1><route.Title @title="Mock OAuth Provider" /></h1> | ||
<main> | ||
<form | ||
method="GET" | ||
action={{redirect_uri}} | ||
> | ||
{{#let (hash | ||
state="state-123456789/abcdefghijklmnopqrstuvwxyz" | ||
code="code-abcdefghijklmnopqrstuvwxyz/123456789" | ||
) as |item|}} | ||
<TextInput | ||
@name="state" | ||
@label="State" | ||
@item={{item}} | ||
@help="The OIDC state value that will get passed through to Consul" | ||
/> | ||
<TextInput | ||
@name="code" | ||
@label="Code" | ||
@item={{item}} | ||
@help="The OIDC code value that will get passed through to Consul" | ||
/> | ||
{{/let}} | ||
<Action | ||
@type="submit" | ||
> | ||
Login | ||
</Action> | ||
</form> | ||
</main> | ||
</div> | ||
</Route> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"AuthURL": "${env('CONSUL_OIDC_PROVIDER_URL')}&redirect_uri=${encodeURIComponent(http.body.RedirectURI)}&response_type=code&scope=openid" | ||
"AuthURL": "${env('CONSUL_OIDC_PROVIDER_URL', 'http://localhost:4200/ui/oauth-provider-debug?client_id=oauth-double&nonce=1&state=123456789abc')}&redirect_uri=${encodeURIComponent(http.body.RedirectURI)}&response_type=code&scope=openid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(routes => routes({ | ||
['oauth-provider-debug']: { | ||
_options: { | ||
path: '/oauth-provider-debug', | ||
queryParams: { | ||
redirect_uri: 'redirect_uri', | ||
response_type: 'response_type', | ||
scope: 'scope', | ||
}, | ||
} | ||
}, | ||
}))( | ||
(json, data = document.currentScript.dataset) => { | ||
const appNameJS = data.appName.split('-') | ||
.map((item, i) => i ? `${item.substr(0, 1).toUpperCase()}${item.substr(1)}` : item) | ||
.join(''); | ||
data[`${appNameJS}Routes`] = JSON.stringify(json); | ||
} | ||
); |