AuthN | Go SDK | Flow Endpoints
Flow Endpoints
Check a token
func (a *ClientToken) Check(ctx context.Context, input ClientTokenCheckRequest) (*pangea.PangeaResponse[ClientTokenCheckResult], error)Look up a token and return its contents.
input := authn.ClientTokenCheckRequest{
Token: "ptu_wuk7tvtpswyjtlsx52b7yyi2l7zotv4a",
}
resp, err := authcli.Client.Token.Check(ctx, input)
Complete sign-up/sign-in
func (a *Flow) Complete(ctx context.Context, input FlowCompleteRequest) (*pangea.PangeaResponse[FlowCompleteResult], error)Complete a sign-up or sign-in flow.
input := authn.FlowCompleteRequest{
FlowID: "pfl_dxiqyuq7ndc5ycjwdgmguwuodizcaqhh",
}
resp, err := authncli.Flow.Complete(ctx, input)
Restart a sign-up/sign-in flow
func (a *Flow) Restart(ctx context.Context, input FlowRestartRequest) (*pangea.PangeaResponse[FlowRestartResult], error)Restart a signup-up/in flow choice.
input := authn.FlowRestartRequest{
FlowID: "pfl_dxiqyuq7ndc5ycjwdgmguwuodizcaqhh",
Choice: authn.FCPassword,
Data: authn.FlowRestartData{},
}
resp, err := authncli.Flow.Restart(ctx, input)
Start a sign-up/sign-in flow
func (a *Flow) Start(ctx context.Context, input FlowStartRequest) (*pangea.PangeaResponse[FlowStartResult], error)Start a new sign-up or sign-in flow.
fts := []FlowType{authn.FTsignin,authn.FTsignup}
input := authn.FlowStartRequest{
CBURI: "https://www.myserver.com/callback",
Email: "joe.user@email.com",
FlowTypes: fts,
Provider: &authn.IDPPassword,
}
resp, err := authncli.Flow.Start(ctx, input)
Update a sign-up/sign-in flow
func (a *Flow) Update(ctx context.Context, input FlowUpdateRequest) (*pangea.PangeaResponse[FlowUpdateResult], error)Update a sign-up/sign-in flow.
input := authn.FlowUpdateRequest{
FlowID: "pfl_dxiqyuq7ndc5ycjwdgmguwuodizcaqhh",
Choice: authn.FCPassword,
Data: authn.FlowUpdateDataPassword{
Password: "somenewpassword",
}
}
resp, err := authncli.Flow.Update(ctx, input)
Type ClientTokenCheckRequest
type ClientTokenCheckRequest structtype ClientTokenCheckRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest
Token string `json:"token"`
}
Type FlowChoice
type FlowChoice stringtype FlowChoice string
Type FlowCompleteRequest
type FlowCompleteRequest structtype FlowCompleteRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest
FlowID string `json:"flow_id"`
}
Type FlowRestartData
type FlowRestartData struct{}type FlowRestartData struct{}
Type FlowRestartRequest
type FlowRestartRequest structtype FlowRestartRequest struct {
pangea.BaseRequest
FlowID string `json:"flow_id"`
Choice FlowChoice `json:"choice"`
Data FlowRestartData `json:"data"`
}
Type FlowStartRequest
type FlowStartRequest structtype FlowStartRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest
CBURI string `json:"cb_uri,omitempty"`
Email string `json:"email,omitempty"`
FlowTypes []FlowType `json:"flow_types,omitempty"`
Provider *IDProvider `json:"provider,omitempty"`
}
Type FlowType
type FlowType stringtype FlowType string
Type FlowUpdateRequest
type FlowUpdateRequest structtype FlowUpdateRequest struct {
pangea.BaseRequest
FlowID string `json:"flow_id"`
Choice FlowChoice `json:"choice"`
Data FlowUpdaterData `json:"data"`
}
Type FlowUpdaterData
type FlowUpdaterData interfacetype FlowUpdaterData interface {
IsFlowUpdaterData() bool
}
Type IDProvider
type IDProvider stringtype IDProvider string