refactor: move iss param handling to Fosite

This commit is contained in:
Elias Schneider
2026-08-12 23:25:35 +02:00
parent 46b8d54e15
commit 1bb21c5d73
5 changed files with 5 additions and 9 deletions
@@ -21,18 +21,15 @@ const parRequestURIPrefix = "urn:ietf:params:oauth:request_uri:"
type authorizationHandler struct {
provider fosite.OAuth2Provider
authorizationService *authorizationService
baseURL string
}
func newAuthorizationHandler(
provider fosite.OAuth2Provider,
authorizationService *authorizationService,
baseURL string,
) *authorizationHandler {
return &authorizationHandler{
provider: provider,
authorizationService: authorizationService,
baseURL: baseURL,
}
}
@@ -99,8 +96,6 @@ func (h *authorizationHandler) authorize(c *gin.Context) {
return
}
response.AddParameter("iss", h.baseURL)
// fosite renders an auto-submitting HTML page for response_mode=form_post, which needs a relaxed CSP
h.relaxCSPForFormPost(c, ar)
+1 -1
View File
@@ -101,7 +101,7 @@ func New(ctx context.Context, deps Dependencies) (*Module, error) {
store: store,
cimdResolver: cimdResolver,
authorizationHandler: newAuthorizationHandler(provider, authorizationService, deps.Config.BaseURL),
authorizationHandler: newAuthorizationHandler(provider, authorizationService),
tokenHandler: newTokenHandler(provider, claimsService, deps.APIAccess),
userInfoHandler: newUserInfoHandler(provider, claimsService, deps.Config.BaseURL),
parHandler: newPARHandler(provider),
+1
View File
@@ -43,6 +43,7 @@ func newProvider(store *Store, authenticator *federatedClientAuthenticator, sign
PushedAuthorizeContextLifespan: 90 * time.Second,
IDTokenIssuer: config.BaseURL,
AccessTokenIssuer: config.BaseURL,
AuthorizationResponseIssuer: config.BaseURL,
TokenURL: config.TokenBaseURL + "/api/oidc/token",
ScopeStrategy: fosite.ExactScopeStrategy,
IgnoreUnknownScopes: true,