Go SDK for Fident web projects
import gofidentweb "github.com/fident/go-web"
Helper library for decoding data from fident authtokens
gofidentweb.InitTokenHelperWithAESAndRSAPub(AESKey,RSAPemLocation)
// Can then call this method to get the currently logged in user
func VerifyRequestToken(r *http.Request) (UserDetails, error)
Generates fident URLS that you can send users to for actions such as login,logout and registration. Generally these actions will direct back to your domain on completion.
// Init the URL helper, set 'fidentRegistrationSecret' to "" if you don't plan on using pre-registered verified registration URLs
gofidentweb.InitURLHelper(productServiceURL, fidentServiceURL, fidentRegistrationSecret)
// Actions now available such as the method below
func GetLoginURL() string
Helper sets up your endpoint for recieving notifications when users change their details in Fident
// Notificationendpoint (registered with fident)
gofidentweb.InitWithRSAPub(pathToFidentPublicKey)
gofidentweb.SetNotificationHandler(fidentNotificationHandler)
server.HandleFunc(NotificationEndpoint, gofidentweb.NotificationEndpoint)
// The following method would be called with a user update notification payload
func fidentNotificationHandler(payload fident.UserUpdatePayload) {