Categorygithub.com/choonkeat-govtech/singpass
modulepackage
0.0.0-20240424021228-dba983f0b015
Repository: https://github.com/choonkeat-govtech/singpass.git
Documentation: pkg.go.dev

# README

Singpass

Add Singpass Login support to your Go HTTP application

http.HandleFunc("/mysingpass/start", singpass.RedirectToSingpass(cfg, singpass.NonceStateToCookie, errHandler))
http.HandleFunc("/mysingpass/callback", singpassCallbackHandler)

After some configuration, see internal/example.go

# Functions

CallbackFromSingpass returns a http.HandlerFunc that can be used as a callback for OAuth2 flow.
ExtractNRICAndUUIDFromPayload extracts NRIC and UUID from the given payload's 'sub' property.
NonceStateFromCookie returns the state from the given request's cookie, previously set by NonceStateToCookie.
NonceStateToCookie sets a cookie with the given NonceState.
RedirectToSingpass returns a http.HandlerFunc that redirects the user to singpass.

# Variables

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

NonceState is a pair of nonce and state; things we keep track of before sending the user to singpass.
NRICAndUUID is a pair of NRIC and UUID.