Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TODO: This static domain and URI should be configurable via an environment variable. // See: https://linear.app/arguslabs/issue/WORLD-995/make-domain-and-uri-configurable-for-siwe-authentication DefaultDomain = "example.com" DefaultURI = "https://example.com/v2/account/authenticate/custom" // DefaultTimeout is the length of time between the issue time and the expiration time. If the current time // is not between the issue time and expiration time of a message, the signature will be rejected. DefaultTimeout = 5 * time.Minute DefaultStatement = "Log in to Nakama using SIWE." )
Variables ¶
Functions ¶
func ValidateSignature ¶
func ValidateSignature(ctx context.Context, nk runtime.NakamaModule, signerAddress, message, signature string) error
ValidateSignature ensures the given message is valid and the given signature is actually a signature for the message.
Types ¶
type GenerateResult ¶
type GenerateResult struct {
SIWEMessage string `json:"siwe_message"`
}
GenerateResult will be serialized to JSON and sent back to a client. The client must sign the message in the SIWEMessage field, and resubmit their authentication request.
func GenerateNewSIWEMessage ¶
func GenerateNewSIWEMessage(signerAddress string) (*GenerateResult, error)
GenerateNewSIWEMessage generates an SIWE Message that can be signed and used to authenticate a user.
Click to show internal directories.
Click to hide internal directories.