Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix connect to IBM Cloud #3715

Merged
merged 1 commit into from
Jul 17, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/jetstream/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (p *portalProxy) ssoLoginToUAA(c echo.Context) error {

func (p *portalProxy) loginToUAA(c echo.Context) error {
log.Debug("loginToUAA")

if interfaces.AuthEndpointTypes[p.Config.ConsoleConfig.AuthEndpointType] != interfaces.Remote {
err := interfaces.NewHTTPShadowError(
http.StatusNotFound,
Expand Down Expand Up @@ -348,7 +348,7 @@ func (p *portalProxy) doLocalLogin(c echo.Context) (string, string, error) {
if len(username) == 0 || len(password) == 0 || len(guid) == 0 {
return guid, username, errors.New("Needs username, password and guid")
}

localUsersRepo, err := localusers.NewPgsqlLocalUsersRepository(p.DatabaseConnectionPool)
if err != nil {
log.Errorf("Database error getting repo for Local users: %v", err)
Expand Down Expand Up @@ -665,7 +665,7 @@ func (p *portalProxy) fetchHTTPBasicToken(cnsiRecord interfaces.CNSIRecord, c ec
}

func (p *portalProxy) FetchOAuth2Token(cnsiRecord interfaces.CNSIRecord, c echo.Context) (*interfaces.UAAResponse, *interfaces.JWTUserTokenInfo, *interfaces.CNSIRecord, error) {
endpoint := cnsiRecord.TokenEndpoint
endpoint := cnsiRecord.AuthorizationEndpoint

tokenEndpoint := fmt.Sprintf("%s/oauth/token", endpoint)

Expand Down Expand Up @@ -727,7 +727,7 @@ func (p *portalProxy) logoutOfCNSI(c echo.Context) error {
if !user.Admin {
return echo.NewHTTPError(http.StatusUnauthorized, "Can not disconnect System Shared endpoint - user is not an administrator")
}
userGUID = tokens.SystemSharedUserGuid
userGUID = tokens.SystemSharedUserGuid
}

// Clear the token
Expand Down