Skip to content

Commit

Permalink
revert some changes
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Dmytrenko <[email protected]>
  • Loading branch information
erka committed May 30, 2024
1 parent 7ffa015 commit 2111e1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion internal/config/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,10 @@ func (a AuthenticationMethodOIDCConfig) info() AuthenticationMethodInfo {
// this ensures we expose the authorize and callback URL endpoint
// to the UI via the /auth/v1/method endpoint
for provider := range a.Providers {
providers[provider] = map[string]any{}
providers[provider] = map[string]any{
"authorize_url": fmt.Sprintf("/auth/v1/method/oidc/%s/authorize", provider),
"callback_url": fmt.Sprintf("/auth/v1/method/oidc/%s/callback", provider),
}
}

metadata["providers"] = providers
Expand Down Expand Up @@ -552,6 +555,9 @@ func (a AuthenticationMethodGithubConfig) info() AuthenticationMethodInfo {

metadata := make(map[string]any)

metadata["authorize_url"] = "/auth/v1/method/github/authorize"
metadata["callback_url"] = "/auth/v1/method/github/callback"

info.Metadata, _ = structpb.NewStruct(metadata)

return info
Expand Down
2 changes: 1 addition & 1 deletion internal/server/authn/method/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (m Middleware) Handler(next http.Handler) http.Handler {
}

if method == "authorize" {
prefix = path.Join(r.Header.Get(xForwardedPrefix), prefix)
prefix = path.Join(path.Join(r.Header.Values(xForwardedPrefix)...), prefix)
query := r.URL.Query()
// create a random security token and bind it to
// the state parameter while preserving any provided
Expand Down

0 comments on commit 2111e1a

Please sign in to comment.