Skip to content

Commit

Permalink
Debugging sso test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jillian Inapurapu authored and Jillian Inapurapu committed Nov 30, 2023
1 parent 4ada4bb commit aeb241a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions restapi/user_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func getLoginDetailsResponse(params authApi.LoginDetailParams, openIDProviders o
// initialize new oauth2 client
oauth2Client, err := openIDProviders.NewOauth2ProviderClient(name, nil, r, GetConsoleHTTPClient("", getClientIP(params.HTTPRequest)), GetConsoleHTTPClient(getMinIOServer(), getClientIP(params.HTTPRequest)))
if err != nil {
return nil, ErrorWithContext(ctx, err, ErrOauth2Provider)
return nil, ErrorWithContext(ctx, errors.New(555, "fake error")) //err, ErrOauth2Provider)
}
// Validate user against IDP
identityProvider := &auth.IdentityProvider{
Expand Down Expand Up @@ -271,7 +271,7 @@ func getLoginOauth2AuthResponse(params authApi.LoginOauth2AuthParams, openIDProv

oauth2Client, err := openIDProviders.NewOauth2ProviderClient(IDPName, nil, r, GetConsoleHTTPClient("", getClientIP(params.HTTPRequest)), GetConsoleHTTPClient(getMinIOServer(), getClientIP(params.HTTPRequest)))
if err != nil {
return nil, ErrorWithContext(ctx, ErrOauth2Provider)
return nil, ErrorWithContext(ctx, errors.New(666, "second errors")) //ErrOauth2Provider)
}
// initialize new identity provider

Expand All @@ -283,7 +283,7 @@ func getLoginOauth2AuthResponse(params authApi.LoginOauth2AuthParams, openIDProv
// Validate user against IDP
userCredentials, err := verifyUserAgainstIDP(ctx, identityProvider, *lr.Code, state)
if err != nil {
return nil, ErrorWithContext(ctx, ErrOauth2Login)
return nil, ErrorWithContext(ctx, errors.New(777, "third errors")) //ErrOauth2Login)
}
// initialize admin client
// login user against console and generate session token
Expand All @@ -292,7 +292,7 @@ func getLoginOauth2AuthResponse(params authApi.LoginOauth2AuthParams, openIDProv
AccountAccessKey: "",
}, nil)
if err != nil {
return nil, ErrorWithContext(ctx, ErrOauth2Login)
return nil, ErrorWithContext(ctx, errors.New(888, "fourth errors")) //ErrOauth2Login)
}
// serialize output
loginResponse := &models.LoginResponse{
Expand Down

0 comments on commit aeb241a

Please sign in to comment.