microsoft

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is an implementation of `auth.Provider` for authenticating using a Office 365 account.

func New

func New(c *config.Auth) (*Config, error)

New creates a new Microsoft provider from a configuration.

func (*Config) Email

func (c *Config) Email(token *oauth2.Token) string

Email retrieves the email address of the user.

func (*Config) Exchange

func (c *Config) Exchange(code string) (*oauth2.Token, error)

Exchange authorizes the session and returns an access token.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of the provider.

func (*Config) Revoke

func (c *Config) Revoke(token *oauth2.Token) error

Revoke disables the access token.

func (*Config) StartSession

func (c *Config) StartSession(state string) string

StartSession retrieves an authentication endpoint from Microsoft.

func (*Config) Username

func (c *Config) Username(token *oauth2.Token) string

Username retrieves the username portion of the user's email address.

func (*Config) Valid

func (c *Config) Valid(token *oauth2.Token) bool

Valid validates the oauth token.

Jump to

Keyboard shortcuts

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