azurecreds

package
v0.0.0-...-8ec3e8a Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package azurecreds implements AAD Username/Password Auth Flow See more:

Amongst supported platform versions are:

  • SharePoint Online + Azure

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthCnfg

type AuthCnfg struct {
	SiteURL  string `json:"siteUrl"`  // SPSite or SPWeb URL, which is the context target for the API calls
	TenantID string `json:"tenantId"` // Azure Tenant ID
	ClientID string `json:"clientId"` // Azure Client ID
	Username string `json:"username"` // AAD user name
	Password string `json:"password"` // AAD user password
	// contains filtered or unexported fields
}

AuthCnfg - AAD Username/Password Auth Flow To use this strategy public client flows mobile and desktop should be enabled in the app registration

Config sample:
{
	"siteUrl": "https://contoso.sharepoint.com/sites/test",
	"tenantId": "e4d43069-8ecb-49c4-8178-5bec83c53e9d",
	"clientId": "628cc712-c9a4-48f0-a059-af64bdbb4be5",
	"username": "user@contoso.com",
	"password": "password"
}

func (*AuthCnfg) GetAuth

func (c *AuthCnfg) GetAuth() (string, int64, error)

GetAuth authenticates, receives access token

func (*AuthCnfg) GetSiteURL

func (c *AuthCnfg) GetSiteURL() string

GetSiteURL gets SharePoint siteURL

func (*AuthCnfg) GetStrategy

func (c *AuthCnfg) GetStrategy() string

GetStrategy gets auth strategy name

func (*AuthCnfg) ParseConfig

func (c *AuthCnfg) ParseConfig(byteValue []byte) error

ParseConfig parses credentials from a provided JSON byte array content

func (*AuthCnfg) ReadConfig

func (c *AuthCnfg) ReadConfig(privateFile string) error

ReadConfig reads private config with auth options

func (*AuthCnfg) SetAuth

func (c *AuthCnfg) SetAuth(req *http.Request, httpClient *gosip.SPClient) error

SetAuth authenticates request noinspection GoUnusedParameter

func (*AuthCnfg) SetMasterkey

func (c *AuthCnfg) SetMasterkey(masterKey string)

SetMasterkey defines custom masterkey

func (*AuthCnfg) WriteConfig

func (c *AuthCnfg) WriteConfig(privateFile string) error

WriteConfig writes private config with auth options

Jump to

Keyboard shortcuts

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