login

package
v1.1.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const ClientCredentialsURL = "https://id.twitch.tv/oauth2/token?grant_type=client_credentials"
View Source
const RefreshTokenURL = "https://id.twitch.tv/oauth2/token?grant_type=refresh_token"
View Source
const RevokeTokenURL = "https://id.twitch.tv/oauth2/revoke"
View Source
const UserAuthorizeURL = "https://id.twitch.tv/oauth2/authorize?response_type=code"
View Source
const UserCredentialsURL = "https://id.twitch.tv/oauth2/token?grant_type=authorization_code"
View Source
const ValidateTokenURL = "https://id.twitch.tv/oauth2/validate"

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationResponse

type AuthorizationResponse struct {
	AccessToken  string   `json:"access_token"`
	RefreshToken string   `json:"refresh_token"`
	ExpiresIn    int64    `json:"expires_in"`
	Scope        []string `json:"scope"`
	TokenType    string   `json:"token_type"`
}

type LoginParameters

type LoginParameters struct {
	ClientID     string
	ClientSecret string
	Scopes       string
	Token        string
	URL          string
	RedirectURL  string
	AuthorizeURL string
}

type LoginResponse

type LoginResponse struct {
	Response  AuthorizationResponse
	ExpiresAt time.Time
}

func ClientCredentialsLogin

func ClientCredentialsLogin(p LoginParameters) (LoginResponse, error)

func CredentialsLogout

func CredentialsLogout(p LoginParameters) (LoginResponse, error)

func RefreshUserToken

func RefreshUserToken(p RefreshParameters) (LoginResponse, error)

func UserCredentialsLogin

func UserCredentialsLogin(p LoginParameters, webserverIP string, webserverPort string) (LoginResponse, error)

type RefreshParameters

type RefreshParameters struct {
	ClientID     string
	ClientSecret string
	RefreshToken string
	URL          string
}

type UserAuthorizationQueryResponse

type UserAuthorizationQueryResponse struct {
	Code  string
	State string
	Error error
}

type ValidateResponse added in v1.1.21

type ValidateResponse struct {
	ClientID  string   `json:"client_id"`
	UserLogin string   `json:"login"`
	UserID    string   `json:"user_id"`
	Scopes    []string `json:"scopes"`
	ExpiresIn int64    `json:"expires_in"`
}

func ValidateCredentials added in v1.1.21

func ValidateCredentials(p LoginParameters) (ValidateResponse, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL