Skip to content

Commit 68ebbb7

Browse files
authored
Add configuration to allow override the IssuerUrl (#197)
1 parent d68742d commit 68ebbb7

4 files changed

Lines changed: 6 additions & 0 deletions

File tree

config/development.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ auth:
1515
- label: Auth0 oidc # for internal use; in future may expose as button text
1616
type: oidc # for futureproofing; only oidc is supported today
1717
providerUrl: https://myorg.us.auth0.com/
18+
issuerUrl: "" # needed if the Issuer Url and the Provider Url are different
1819
clientId: xxxxxxxxxxxxxxxxxxxx
1920
clientSecret: xxxxxxxxxxxxxxxxxxxx
2021
scopes:

docker/config_template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ auth:
2929
- label: {{ default .Env.TEMPORAL_AUTH_LABEL "sso" }}
3030
type: {{ default .Env.TEMPORAL_AUTH_TYPE "oidc" }}
3131
providerUrl: {{ .Env.TEMPORAL_AUTH_PROVIDER_URL }}
32+
issuerUrl: {{ default .Env.TEMPORAL_AUTH_ISSUER_URL "" }}
3233
clientId: {{ .Env.TEMPORAL_AUTH_CLIENT_ID }}
3334
clientSecret: {{ .Env.TEMPORAL_AUTH_CLIENT_SECRET }}
3435
callbackUrl: {{ .Env.TEMPORAL_AUTH_CALLBACK_URL }}

server/config/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ type (
7979
Label string `yaml:"label"`
8080
Type string `yaml:"type"`
8181
ProviderUrl string `yaml:"providerUrl"`
82+
IssuerUrl string `yaml:"issuerUrl"`
8283
ClientID string `yaml:"clientId"`
8384
ClientSecret string `yaml:"clientSecret"`
8485
Scopes []string `yaml:"scopes"`

server/routes/auth.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ func SetAuthRoutes(e *echo.Echo, cfgProvider *config.ConfigProviderWithRefresh)
5858

5959
providerCfg := serverCfg.Auth.Providers[0] // only single provider is currently supported
6060

61+
if len(providerCfg.IssuerUrl) > 0 {
62+
ctx = oidc.InsecureIssuerURLContext(ctx, providerCfg.IssuerUrl)
63+
}
6164
provider, err := oidc.NewProvider(ctx, providerCfg.ProviderUrl)
6265
if err != nil {
6366
log.Fatal(err)

0 commit comments

Comments
 (0)