MCPcopy
hub / github.com/oauth2-proxy/oauth2-proxy / encodeState

Function encodeState

oauthproxy.go:1282–1288  ·  view source on GitHub ↗

encodeState builds the OAuth state param out of our nonce and original application redirect

(nonce string, redirect string, encode bool)

Source from the content-addressed store, hash-verified

1280// encodeState builds the OAuth state param out of our nonce and
1281// original application redirect
1282func encodeState(nonce string, redirect string, encode bool) string {
1283 rawString := fmt.Sprintf("%v:%v", nonce, redirect)
1284 if encode {
1285 return base64.RawURLEncoding.EncodeToString([]byte(rawString))
1286 }
1287 return rawString
1288}
1289
1290// decodeState splits the reflected OAuth state response back into
1291// the nonce and original application redirect

Callers 3

doOAuthStartMethod · 0.85
getCallbackEndpointMethod · 0.85

Calls

no outgoing calls

Tested by 2

getCallbackEndpointMethod · 0.68