This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
forked from sstarcher/go-okta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
authn.go
68 lines (64 loc) · 1.93 KB
/
authn.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package okta
import (
"time"
)
type ErrorResponse struct {
ErrorCode string `json:"errorCode"`
ErrorSummary string `json:"errorSummary"`
ErrorLink string `json:"errorLink"`
ErrorID string `json:"errorId"`
ErrorCauses []struct {
ErrorSummary string `json:"errorSummary"`
} `json:"errorCauses"`
}
type AuthnRequest struct {
Username string `json:"username"`
Password string `json:"password"`
RelayState string `json:"relayState"`
Options struct {
MultiOptionalFactorEnroll bool `json:"multiOptionalFactorEnroll"`
WarnBeforePasswordExpired bool `json:"warnBeforePasswordExpired"`
} `json:"options"`
}
type AuthnResponse struct {
StateToken string `json:"stateToken"`
ExpiresAt time.Time `json:"expiresAt"`
Status string `json:"status"`
RelayState string `json:"relayState"`
FactorResult string `json:"factorResult"`
SessionToken string `json:"sessionToken"`
Embedded struct {
User struct {
ID string `json:"id"`
PasswordChanged time.Time `json:"passwordChanged"`
Profile struct {
Login string `json:"login"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Locale string `json:"locale"`
TimeZone string `json:"timeZone"`
} `json:"profile"`
} `json:"user"`
Factors []Factor `json:"factors"`
Policy struct {
AllowRememberDevice bool `json:"allowRememberDevice"`
RememberDeviceLifetimeInMinutes int `json:"rememberDeviceLifetimeInMinutes"`
RememberDeviceByDefault bool `json:"rememberDeviceByDefault"`
} `json:"policy"`
} `json:"_embedded"`
Links struct {
Cancel struct {
Href string `json:"href"`
Hints struct {
Allow []string `json:"allow"`
} `json:"hints"`
} `json:"cancel"`
Next struct {
Name string `json:"name"`
Href string `json:"href"`
Hints struct {
Allow []string `json:"allow"`
} `json:"hints"`
}
} `json:"_links"`
}