1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-07-15 01:44:22 +02:00

De-duplicate code in GetLoginURL of in logingov provider

Also add unit test to ensure logingov specific logic is applied.
This commit is contained in:
Alexander Block
2020-09-14 13:55:47 +02:00
parent fde09bea4e
commit 9a64e67d5b
2 changed files with 11 additions and 12 deletions

View File

@ -289,3 +289,10 @@ func TestLoginGovProviderBadNonce(t *testing.T) {
// The "badfakenonce" in the idtoken above should cause this to error out
assert.Error(t, err)
}
func TestLoginGovProviderGetLoginURL(t *testing.T) {
p, _, _ := newLoginGovProvider()
result := p.GetLoginURL("http://redirect/", "")
assert.Contains(t, result, "acr_values="+url.QueryEscape("http://idmanagement.gov/ns/assurance/loa/1"))
assert.Contains(t, result, "nonce=fakenonce")
}