auth

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const AUTH_METHOD = "FormsAuthentication"
View Source
const CLIENT_ID = "E10493A3B1024F14BDC7D0D8B9F649E9-234390"
View Source
const CODE_URL = "" /* 295-byte string literal not displayed */
View Source
const CONTENT_TYPE = "application/x-www-form-urlencoded"
View Source
const CREDENTIALS_FILE_NAME = lominus.CREDENTIALS_FILE_NAME
View Source
const EXPIRY_HOURS = 1
View Source
const GRANT_TYPE = "authorization_code"
View Source
const JWT_URL = "https://luminus.nus.edu.sg/v2/api/login/adfstoken"
View Source
const POST = "POST"
View Source
const REDIRECT_URI = "https://luminus.nus.edu.sg/auth/callback"
View Source
const RESOURCE = "sg_edu_nus_oauth"
View Source
const USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:94.0) Gecko/20100101 Firefox/94.0"

Variables

This section is empty.

Functions

func RetrieveJwtToken

func RetrieveJwtToken(credentials Credentials, save bool) (string, error)

func SaveCredentials

func SaveCredentials(credentialsPath string, credentials Credentials) error

Types

type Credentials

type Credentials struct {
	Username string
	Password string
}

func LoadCredentials

func LoadCredentials(credentialsPath string) (Credentials, error)

type JsonResponse

type JsonResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	ExpiresIn   int    `json:"expires_in"`
}

type JwtData

type JwtData struct {
	JwtToken string
	Expiry   int64
}

func LoadJwtData

func LoadJwtData(jwtPath string) (JwtData, error)

func (JwtData) IsExpired

func (jwtData JwtData) IsExpired() bool

type JwtExpiredError

type JwtExpiredError struct{}

func (*JwtExpiredError) Error

func (e *JwtExpiredError) Error() string

Jump to

Keyboard shortcuts

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