Wire loginURL to token request endpoint
@@ -144,7 +144,12 @@ func (c *OAuthServerConfig) WithOAuth(handler http.Handler) (http.Handler, error
)
server.Install(mux, urls.OpenShiftOAuthAPIPrefix)
- tokenRequestEndpoints := tokenrequest.NewEndpoints(c.ExtraOAuthConfig.Options.MasterPublicURL, openShiftLogoutPrefix, c.getOsinOAuthClient, c.ExtraOAuthConfig.OAuthAccessTokenClient)
+ loginURL := c.ExtraOAuthConfig.Options.LoginURL
+ if len(loginURL) == 0 {
+ loginURL = c.ExtraOAuthConfig.Options.MasterPublicURL
+ }
+
+ tokenRequestEndpoints := tokenrequest.NewEndpoints(loginURL, openShiftLogoutPrefix, c.getOsinOAuthClient, c.ExtraOAuthConfig.OAuthAccessTokenClient)
tokenRequestEndpoints.Install(mux, urls.OpenShiftOAuthAPIPrefix)
if session := c.ExtraOAuthConfig.SessionAuth; session != nil {
