Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wellknown #427

Merged
merged 22 commits into from
May 10, 2017
2 changes: 1 addition & 1 deletion cmd/host.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ OAUTH2 CONTROLS
- CONSENT_URL: The uri of the consent endpoint.
Example: CONSENT_URL=https://id.myapp.com/consent
- ISSUER: The issuer is used for identification in all OAuth2 tokens.
- ISSUER: The issuer is used for identification in all OAuth2 tokens. Should be the public url of the server.
Defaults to ISSUER=hydra.localhost
- AUTH_CODE_LIFESPAN: Lifespan of OAuth2 authorize codes. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
Expand Down
3 changes: 3 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ func initConfig() {
fmt.Println("")
}

iss := viper.Get("ISSUER")
viper.Set("ISSUER", strings.TrimSuffix(iss.(string), "/"))

if err := viper.Unmarshal(c); err != nil {
fatal(fmt.Sprintf("Could not read config because %s.", err))
}
Expand Down
1 change: 1 addition & 0 deletions cmd/server/handler_oauth2_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ func newOAuth2Handler(c *config.Config, router *httprouter.Router, km jwk.Manage
H: herodot.NewJSONWriter(c.GetLogger()),
AccessTokenLifespan: c.GetAccessTokenLifespan(),
CookieStore: sessions.NewCookieStore(c.GetCookieSecret()),
Issuer: c.Issuer,
}

handler.SetRoutes(router)
Expand Down
Loading