Documentation
¶
Index ¶
- Variables
- type AuthClient
- type DeviceAuthResponse
- type ExchangeResponse
- type GetDeviceCodeResponse
- type Payload
- type PayloadAuthorizationCode
- type PayloadClientCredentials
- type PayloadContinuationToken
- type PayloadDeviceAuth
- type PayloadDeviceCode
- type PayloadExchangeCode
- type PayloadExternalAuth
- type PayloadOTP
- type PayloadPassword
- type PayloadRefreshToken
- type PayloadTokenToToken
- type TokenResponse
- type VerifyTokenResponse
- type VerifyTokenResponsePermission
Constants ¶
This section is empty.
Variables ¶
View Source
var FortniteNewIOSClient = &AuthClient{consts.FortniteNewIOSClientID, consts.FortniteNewIOSClientSecret}
View Source
var FortnitePS4USClient = &AuthClient{consts.FortnitePS4USClientID, consts.FortnitePS4USClientSecret}
Functions ¶
This section is empty.
Types ¶
type AuthClient ¶
func (*AuthClient) Base64 ¶
func (ac *AuthClient) Base64() string
func (*AuthClient) String ¶
func (ac *AuthClient) String() string
type DeviceAuthResponse ¶
type DeviceAuthResponse struct {
AccountID string `json:"accountId"`
Created struct {
DateTime time.Time `json:"dateTime"`
IpAddress string `json:"ipAddress"`
Location string `json:"location"`
} `json:"created"`
DeviceID string `json:"deviceId"`
Secret string `json:"secret"`
UserAgent string `json:"userAgent"`
}
func CreateDeviceAuth ¶
func CreateDeviceAuth(httpClient *http.Client, credentials *TokenResponse) (DeviceAuthResponse, error)
type ExchangeResponse ¶
type ExchangeResponse struct {
Code string `json:"code"`
CreatingClientID string `json:"creatingClientId"`
ExpiresInSeconds int `json:"expiresInSeconds"`
}
func GetExchangeCode ¶
func GetExchangeCode(httpClient *http.Client, credentials *TokenResponse) (ExchangeResponse, error)
type GetDeviceCodeResponse ¶
type GetDeviceCodeResponse struct {
UserCode string `json:"user_code"`
DeviceCode string `json:"device_code"`
VerificationURI string `json:"verification_uri"`
VerificationURIComplete string `json:"verification_uri_complete"`
Prompt string `json:"prompt"`
ExpiresIn int `json:"expires_in"`
Interval int `json:"interval"`
ClientID string `json:"client_id"`
}
func CreateDeviceCode ¶
func CreateDeviceCode(httpClient *http.Client, credentials *TokenResponse) (GetDeviceCodeResponse, error)
type Payload ¶
type Payload interface {
PayloadAuthorizationCode | PayloadClientCredentials | PayloadContinuationToken |
PayloadDeviceAuth | PayloadDeviceCode | PayloadExchangeCode | PayloadExternalAuth |
PayloadOTP | PayloadPassword | PayloadRefreshToken | PayloadTokenToToken
}
type PayloadAuthorizationCode ¶
type PayloadAuthorizationCode struct {
Code string `json:"code"`
}
type PayloadClientCredentials ¶
type PayloadClientCredentials struct{}
type PayloadContinuationToken ¶
type PayloadContinuationToken struct {
ContinuationToken string `json:"continuation_token"`
}
type PayloadDeviceAuth ¶
type PayloadDeviceCode ¶
type PayloadDeviceCode struct {
DeviceCode string `json:"device_code"`
}
type PayloadExchangeCode ¶
type PayloadExchangeCode struct {
ExchangeCode string `json:"exchange_code"`
}
type PayloadExternalAuth ¶
type PayloadExternalAuth struct {
ExternalAuthToken string `json:"external_auth_token"`
}
type PayloadOTP ¶
type PayloadOTP struct {
OTP string `json:"otp"`
}
type PayloadPassword ¶
type PayloadRefreshToken ¶
type PayloadRefreshToken struct {
RefreshToken string `json:"refresh_token"`
}
type PayloadTokenToToken ¶
type PayloadTokenToToken struct {
AccessToken string `json:"access_token"`
}
type TokenResponse ¶
type TokenResponse struct {
AccessToken string `json:"access_token"`
ExpiresIn int `json:"expires_in"`
ExpiresAt time.Time `json:"expires_at"`
TokenType string `json:"token_type"`
RefreshToken string `json:"refresh_token"`
RefreshExpires int `json:"refresh_expires"`
RefreshExpiresAt time.Time `json:"refresh_expires_at"`
AccountID string `json:"account_id"`
ClientID string `json:"client_id"`
InternalClient bool `json:"internal_client"`
ClientService string `json:"client_service"`
DisplayName string `json:"displayName"`
App string `json:"app"`
InAppID string `json:"in_app_id"`
DeviceID string `json:"device_id"`
ProductID string `json:"product_id"`
ApplicationID string `json:"application_id"`
ACR string `json:"acr"`
AuthTime time.Time `json:"auth_time"`
}
func Authenticate ¶
func Authenticate[T Payload](httpClient *http.Client, client *AuthClient, payload T, eg1 bool) (TokenResponse, error)
type VerifyTokenResponse ¶
type VerifyTokenResponse struct {
Token string `json:"token"`
SessionID string `json:"session_id"`
TokenType string `json:"token_type"`
ClientID string `json:"client_id"`
InternalClient bool `json:"internal_client"`
ClientService string `json:"client_service"`
AccountID string `json:"account_id"`
ExpiresIn int `json:"expires_in"`
ExpiresAt time.Time `json:"expires_at"`
AuthMethod string `json:"auth_method"`
DisplayName string `json:"display_name"`
App string `json:"app"`
InAppID string `json:"in_app_id"`
DeviceID string `json:"device_id"`
Scope []string `json:"scope"`
ProductID string `json:"product_id"`
SandboxID string `json:"sandbox_id"`
DeploymentID string `json:"deployment_id"`
ApplicationID string `json:"application_id"`
ACR string `json:"acr"`
AuthTime time.Time `json:"auth_time"`
Perms []VerifyTokenResponsePermission `json:"perms"`
}
func VerifyToken ¶
Click to show internal directories.
Click to hide internal directories.