|
|
|
@ -694,8 +694,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -716,8 +716,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantRedirectLocationRegexp: happyAuthcodeDownstreamRedirectLocationRegexp,
|
|
|
|
@ -737,8 +737,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&upstreamActiveDirectoryIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantRedirectLocationRegexp: happyAuthcodeDownstreamRedirectLocationRegexp,
|
|
|
|
@ -928,8 +928,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: "/some/path",
|
|
|
|
|
contentType: formContentType,
|
|
|
|
|
body: encodeQuery(happyGetRequestQueryMap),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -952,8 +952,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: "/some/path",
|
|
|
|
|
contentType: formContentType,
|
|
|
|
|
body: encodeQuery(happyGetRequestQueryMap),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantRedirectLocationRegexp: happyAuthcodeDownstreamRedirectLocationRegexp,
|
|
|
|
@ -975,8 +975,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: "/some/path",
|
|
|
|
|
contentType: formContentType,
|
|
|
|
|
body: encodeQuery(happyGetRequestQueryMap),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantRedirectLocationRegexp: happyAuthcodeDownstreamRedirectLocationRegexp,
|
|
|
|
@ -1131,8 +1131,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{
|
|
|
|
|
"redirect_uri": downstreamRedirectURIWithDifferentPort, // not the same port number that is registered for the client
|
|
|
|
|
}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -1155,8 +1155,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{
|
|
|
|
|
"redirect_uri": downstreamRedirectURIWithDifferentPort, // not the same port number that is registered for the client
|
|
|
|
|
}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantRedirectLocationRegexp: downstreamRedirectURIWithDifferentPort + `\?code=([^&]+)&scope=openid\+username\+groups&state=` + happyState,
|
|
|
|
@ -1195,8 +1195,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithEmptyRefreshToken().WithAccessToken(oidcUpstreamAccessToken, metav1.NewTime(time.Now().Add(9*time.Hour))).WithUserInfoURL().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -1217,8 +1217,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithEmptyRefreshToken().WithAccessToken(oidcUpstreamAccessToken, metav1.NewTime(time.Now().Add(1*time.Hour))).WithUserInfoURL().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -1250,8 +1250,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithoutRefreshToken().WithAccessToken(oidcUpstreamAccessToken, metav1.NewTime(time.Now().Add(9*time.Hour))).WithUserInfoURL().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -1272,8 +1272,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&erroringUpstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusBadGateway,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantBodyString: "Bad Gateway: unexpected error during upstream authentication\n",
|
|
|
|
@ -1283,8 +1283,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&erroringUpstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusBadGateway,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantBodyString: "Bad Gateway: unexpected error during upstream authentication\n",
|
|
|
|
@ -1299,8 +1299,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr("wrong-password"),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String("wrong-password"),
|
|
|
|
|
wantPasswordGrantCall: &expectedPasswordGrant{
|
|
|
|
|
performedByUpstreamName: oidcPasswordGrantUpstreamName,
|
|
|
|
|
args: &oidctestutil.PasswordCredentialsGrantAndValidateTokensArgs{
|
|
|
|
@ -1317,8 +1317,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr("wrong-password"),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String("wrong-password"),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithBadUsernamePasswordHintErrorQuery),
|
|
|
|
@ -1329,8 +1329,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&upstreamActiveDirectoryIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr("wrong-password"),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String("wrong-password"),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithBadUsernamePasswordHintErrorQuery),
|
|
|
|
@ -1341,8 +1341,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr("wrong-username"),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String("wrong-username"),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithBadUsernamePasswordHintErrorQuery),
|
|
|
|
@ -1353,8 +1353,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&upstreamActiveDirectoryIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr("wrong-username"),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String("wrong-username"),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithBadUsernamePasswordHintErrorQuery),
|
|
|
|
@ -1366,7 +1366,7 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: nil, // do not send header
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithMissingUsernamePasswordHintErrorQuery),
|
|
|
|
@ -1378,7 +1378,7 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: nil, // do not send header
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithMissingUsernamePasswordHintErrorQuery),
|
|
|
|
@ -1390,7 +1390,7 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: nil, // do not send header
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithMissingUsernamePasswordHintErrorQuery),
|
|
|
|
@ -1401,7 +1401,7 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: nil, // do not send header
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1413,7 +1413,7 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&upstreamActiveDirectoryIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: nil, // do not send header
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1425,8 +1425,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithoutRefreshToken().WithAccessToken(oidcUpstreamAccessToken, metav1.NewTime(time.Now().Add(9*time.Hour))).WithoutUserInfoURL().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1438,8 +1438,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithEmptyRefreshToken().WithAccessToken(oidcUpstreamAccessToken, metav1.NewTime(time.Now().Add(9*time.Hour))).WithoutUserInfoURL().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1451,8 +1451,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithEmptyRefreshToken().WithEmptyAccessToken().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1464,8 +1464,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithoutRefreshToken().WithoutAccessToken().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1477,8 +1477,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithoutRefreshToken().WithEmptyAccessToken().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1490,8 +1490,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().WithEmptyRefreshToken().WithoutAccessToken().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1503,7 +1503,7 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: nil, // do not send header
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -1515,8 +1515,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(upstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithPasswordGrantDisallowedHintErrorQuery),
|
|
|
|
@ -1528,8 +1528,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
kubeResources: addFullyCapableDynamicClientAndSecretToKubeResources,
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"client_id": dynamicClientID, "scope": testutil.AllDynamicClientScopesSpaceSep}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithUsernamePasswordHeadersDisallowedHintErrorQuery),
|
|
|
|
@ -1541,8 +1541,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
kubeResources: addFullyCapableDynamicClientAndSecretToKubeResources,
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"client_id": dynamicClientID, "scope": testutil.AllDynamicClientScopesSpaceSep}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithUsernamePasswordHeadersDisallowedHintErrorQuery),
|
|
|
|
@ -1554,8 +1554,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
kubeResources: addFullyCapableDynamicClientAndSecretToKubeResources,
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"client_id": dynamicClientID, "scope": testutil.AllDynamicClientScopesSpaceSep}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeAccessDeniedWithUsernamePasswordHeadersDisallowedHintErrorQuery),
|
|
|
|
@ -1603,8 +1603,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{
|
|
|
|
|
"redirect_uri": "http://127.0.0.1/does-not-match-what-is-configured-for-pinniped-cli-client",
|
|
|
|
|
}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusBadRequest,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantBodyJSON: fositeInvalidRedirectURIErrorBody,
|
|
|
|
@ -1616,8 +1616,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{
|
|
|
|
|
"redirect_uri": "http://127.0.0.1/does-not-match-what-is-configured-for-pinniped-cli-client",
|
|
|
|
|
}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusBadRequest,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantBodyJSON: fositeInvalidRedirectURIErrorBody,
|
|
|
|
@ -1629,8 +1629,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{
|
|
|
|
|
"redirect_uri": "http://127.0.0.1/does-not-match-what-is-configured-for-pinniped-cli-client",
|
|
|
|
|
}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusBadRequest,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantBodyJSON: fositeInvalidRedirectURIErrorBody,
|
|
|
|
@ -1654,8 +1654,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"client_id": "invalid-client"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusUnauthorized,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantBodyJSON: fositeInvalidClientErrorBody,
|
|
|
|
@ -1718,8 +1718,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"response_type": "unsupported"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeUnsupportedResponseTypeErrorQuery),
|
|
|
|
@ -1730,8 +1730,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"response_type": "unsupported"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeUnsupportedResponseTypeErrorQuery),
|
|
|
|
@ -1767,8 +1767,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&upstreamActiveDirectoryIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"response_type": "unsupported"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeUnsupportedResponseTypeErrorQuery),
|
|
|
|
@ -1835,8 +1835,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"scope": "openid profile email tuna"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeInvalidScopeErrorQuery),
|
|
|
|
@ -1876,8 +1876,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"scope": "openid tuna"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeInvalidScopeErrorQuery),
|
|
|
|
@ -1888,8 +1888,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&upstreamActiveDirectoryIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"scope": "openid tuna"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeInvalidScopeErrorQuery),
|
|
|
|
@ -1931,8 +1931,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"response_type": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeMissingResponseTypeErrorQuery),
|
|
|
|
@ -1943,8 +1943,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"response_type": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeMissingResponseTypeErrorQuery),
|
|
|
|
@ -1976,8 +1976,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithActiveDirectory(&upstreamActiveDirectoryIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"response_type": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeMissingResponseTypeErrorQuery),
|
|
|
|
@ -2023,8 +2023,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"client_id": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusUnauthorized,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantBodyJSON: fositeInvalidClientErrorBody,
|
|
|
|
@ -2074,8 +2074,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2088,8 +2088,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeMissingCodeChallengeErrorQuery),
|
|
|
|
@ -2132,8 +2132,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge_method": "this-is-not-a-valid-pkce-alg"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2146,8 +2146,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge_method": "this-is-not-a-valid-pkce-alg"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeInvalidCodeChallengeErrorQuery),
|
|
|
|
@ -2190,8 +2190,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge_method": "plain"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2204,8 +2204,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge_method": "plain"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeMissingCodeChallengeMethodErrorQuery),
|
|
|
|
@ -2248,8 +2248,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge_method": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2262,8 +2262,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"code_challenge_method": ""}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeMissingCodeChallengeMethodErrorQuery),
|
|
|
|
@ -2312,8 +2312,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"prompt": "none login"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2328,8 +2328,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"prompt": "none login"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositePromptHasNoneAndOtherValueErrorQuery),
|
|
|
|
@ -2383,8 +2383,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
// The following prompt value is illegal when openid is requested, but note that openid is not requested.
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"prompt": "none login", "scope": "email"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2406,8 +2406,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
// The following prompt value is illegal when openid is requested, but note that openid is not requested.
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"prompt": "none login", "scope": "email"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
|
wantRedirectLocationRegexp: downstreamRedirectURI + `\?code=([^&]+)&scope=username\+groups&state=` + happyState, // username and groups scopes were not requested, but are granted anyway for backwards compatibility
|
|
|
|
@ -2429,8 +2429,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2455,8 +2455,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2482,8 +2482,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2510,8 +2510,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2537,8 +2537,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2555,8 +2555,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2570,8 +2570,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2595,8 +2595,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2620,8 +2620,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2644,8 +2644,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2659,8 +2659,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: htmlContentType,
|
|
|
|
@ -2683,8 +2683,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2698,8 +2698,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2713,8 +2713,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2728,8 +2728,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2743,8 +2743,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2758,8 +2758,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2773,8 +2773,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2788,8 +2788,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2803,8 +2803,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2818,8 +2818,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2833,8 +2833,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: happyGetRequestPath,
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantPasswordGrantCall: happyUpstreamPasswordGrantMockExpectation,
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
@ -2877,8 +2877,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithOIDC(passwordGrantUpstreamOIDCIdentityProviderBuilder().Build()),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"state": "short"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(oidcUpstreamPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(oidcUpstreamUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(oidcUpstreamPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeInvalidStateErrorQuery),
|
|
|
|
@ -2889,8 +2889,8 @@ func TestAuthorizationEndpoint(t *testing.T) {
|
|
|
|
|
idps: oidctestutil.NewUpstreamIDPListerBuilder().WithLDAP(&upstreamLDAPIdentityProvider),
|
|
|
|
|
method: http.MethodGet,
|
|
|
|
|
path: modifiedHappyGetRequestPath(map[string]string{"state": "short"}),
|
|
|
|
|
customUsernameHeader: pointer.StringPtr(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.StringPtr(happyLDAPPassword),
|
|
|
|
|
customUsernameHeader: pointer.String(happyLDAPUsername),
|
|
|
|
|
customPasswordHeader: pointer.String(happyLDAPPassword),
|
|
|
|
|
wantStatus: http.StatusFound,
|
|
|
|
|
wantContentType: jsonContentType,
|
|
|
|
|
wantLocationHeader: urlWithQuery(downstreamRedirectURI, fositeInvalidStateErrorQuery),
|
|
|
|
|