mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-24 06:27:17 +02:00
mcp: redirect to upstream oauth2 for authentication (#5594)
This commit is contained in:
parent
5b024a8ada
commit
561b6040b5
4 changed files with 166 additions and 9 deletions
|
@ -68,7 +68,12 @@ func (srv *Handler) Authorize(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
srv.AuthorizationResponse(ctx, w, r, id, v)
|
||||
loginURL, ok := srv.relyingParties.GetLoginURLForHost(r.Host, id)
|
||||
if ok {
|
||||
http.Redirect(w, r, loginURL, http.StatusFound)
|
||||
} else {
|
||||
srv.AuthorizationResponse(ctx, w, r, id, v)
|
||||
}
|
||||
}
|
||||
|
||||
// AuthorizationResponse generates the successful authorization response
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue