diff --git a/providers/azure.go b/providers/azure.go index 4097819b..e114b5ec 100644 --- a/providers/azure.go +++ b/providers/azure.go @@ -219,5 +219,5 @@ func (p *AzureProvider) ValidateGroup(s *SessionState) bool { } } } - return false + return true } diff --git a/providers/azure_test.go b/providers/azure_test.go index 1c25e12a..22d6ccba 100644 --- a/providers/azure_test.go +++ b/providers/azure_test.go @@ -38,9 +38,9 @@ func TestAzureProviderDefaults(t *testing.T) { p.Data().LoginURL.String()) assert.Equal(t, "https://login.microsoftonline.com/common/oauth2/token", p.Data().RedeemURL.String()) - assert.Equal(t, "https://graph.windows.net/me?api-version=1.6", + assert.Equal(t, "https://graph.microsoft.com/v1.0/me", p.Data().ProfileURL.String()) - assert.Equal(t, "https://graph.windows.net", + assert.Equal(t, "https://graph.microsoft.com", p.Data().ProtectedResource.String()) assert.Equal(t, "", p.Data().ValidateURL.String()) @@ -94,9 +94,9 @@ func TestAzureSetTenant(t *testing.T) { p.Data().LoginURL.String()) assert.Equal(t, "https://login.microsoftonline.com/example/oauth2/token", p.Data().RedeemURL.String()) - assert.Equal(t, "https://graph.windows.net/me?api-version=1.6", + assert.Equal(t, "https://graph.microsoft.com/v1.0/me", p.Data().ProfileURL.String()) - assert.Equal(t, "https://graph.windows.net", + assert.Equal(t, "https://graph.microsoft.com", p.Data().ProtectedResource.String()) assert.Equal(t, "", p.Data().ValidateURL.String()) @@ -104,8 +104,8 @@ func TestAzureSetTenant(t *testing.T) { } func testAzureBackend(payload string) *httptest.Server { - path := "/me" - query := "api-version=1.6" + path := "/v1.0/me" + query := "" return httptest.NewServer(http.HandlerFunc( func(w http.ResponseWriter, r *http.Request) { diff --git a/providers/google_test.go b/providers/google_test.go index 8f9b0542..3b700bac 100644 --- a/providers/google_test.go +++ b/providers/google_test.go @@ -110,16 +110,16 @@ func TestGoogleProviderValidateGroup(t *testing.T) { p.GroupValidator = func(email string) bool { return email == "michael.bland@gsa.gov" } - assert.Equal(t, true, p.ValidateGroup("michael.bland@gsa.gov")) + assert.Equal(t, true, p.ValidateGroup(&SessionState{Email:"michael.bland@gsa.gov"})) p.GroupValidator = func(email string) bool { return email != "michael.bland@gsa.gov" } - assert.Equal(t, false, p.ValidateGroup("michael.bland@gsa.gov")) + assert.Equal(t, false, p.ValidateGroup(&SessionState{Email:"michael.bland@gsa.gov"})) } func TestGoogleProviderWithoutValidateGroup(t *testing.T) { p := newGoogleProvider() - assert.Equal(t, true, p.ValidateGroup("michael.bland@gsa.gov")) + assert.Equal(t, true, p.ValidateGroup(&SessionState{Email:"michael.bland@gsa.gov"})) } //