token

package
v0.0.0-...-3d04876 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAccessTokenRequest

func CreateAccessTokenRequest(host string, cid string, uid string, upw string, ressource string) (*http.Request, error)

CreateAccessTokenRequest creates the http request to obtain an access token

func CreateRefreshTokenRequest

func CreateRefreshTokenRequest(host string, cid string, uid string, upw string, ressource string) (*http.Request, error)

CreateRefreshTokenRequest creates the http request to obtain an refresh token

func ExtractToken

func ExtractToken(body []byte) (string, string, string, error)

ExtractToken extracts the access token and the refresh token from the http response body

func GetTokenClaims

func GetTokenClaims(tokenString string) (jwt.MapClaims, error)

GetTokenClaims retrieves the claims from a token

func GetTokens

func GetTokens(ressource string) (jwt.MapClaims, error)

GetTokens handles all stuff that is needed for getting an access token

func RefreshToken

func RefreshToken(ressource string) error

RefreshToken handles all stuff that is needed for refreshing the access token

func SendAccessTokenRequest

func SendAccessTokenRequest(req *http.Request) ([]byte, error)

SendAccessTokenRequest sends the access token request

func SendRefreshTokenRequest

func SendRefreshTokenRequest(req *http.Request) ([]byte, error)

SendRefreshTokenRequest sends the refresh token request

func WriteTokensToConfig

func WriteTokensToConfig(token, refreshToken string, ressource string)

WriteTokensToConfig stores access token and refresh token in the config file for later usage

Types

This section is empty.

Jump to

Keyboard shortcuts

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