You've already forked oauth2-proxy
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:
@ -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")
|
||||
}
|
||||
|
Reference in New Issue
Block a user