feat: new env variable for server URI
This commit is contained in:
@ -23,11 +23,11 @@ func (h *OAuthHandler) OpenIdConfiguration(w http.ResponseWriter, r *http.Reques
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
if err := encoder.Encode(Response{
|
||||
TokenEndpoint: h.cfg.Jwt.Issuer + "/api/v1/oauth/token",
|
||||
AuthorizationEndpoint: h.cfg.Jwt.Issuer + "/api/v1/oauth/authorize",
|
||||
JwksURI: h.cfg.Jwt.Issuer + "/.well-known/jwks.json",
|
||||
Issuer: h.cfg.Jwt.Issuer,
|
||||
EndSessionEndpoint: h.cfg.Jwt.Issuer + "/api/v1/oauth/logout",
|
||||
TokenEndpoint: h.cfg.Uri + "/api/v1/oauth/token",
|
||||
AuthorizationEndpoint: h.cfg.Uri + "/api/v1/oauth/authorize",
|
||||
JwksURI: h.cfg.Uri + "/.well-known/jwks.json",
|
||||
Issuer: h.cfg.Uri,
|
||||
EndSessionEndpoint: h.cfg.Uri + "/api/v1/oauth/logout",
|
||||
}); err != nil {
|
||||
web.Error(w, "failed to encode response", http.StatusInternalServerError)
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ func (h *OAuthHandler) tokenEndpoint(w http.ResponseWriter, r *http.Request) {
|
||||
Nonce: nonce,
|
||||
Roles: roles,
|
||||
RegisteredClaims: jwt.RegisteredClaims{
|
||||
Issuer: h.cfg.Jwt.Issuer,
|
||||
Issuer: h.cfg.Uri,
|
||||
// TODO: use dedicated API id that is in local DB and bind to user there
|
||||
Subject: user.ID.String(),
|
||||
Audience: jwt.ClaimStrings{clientId},
|
||||
|
Reference in New Issue
Block a user