Documentation ¶
Overview ¶
Package azureenv implements AAD Environment-Based Auth Flow See more:
- https://docs.microsoft.com/en-us/azure/developer/go/azure-sdk-authorization#use-environment-based-authentication
- https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azuread
- https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal
Amongst supported platform versions are:
- SharePoint Online + Azure
Azure Environment-Based supported strategies:
- Client credentials (might not work with SharePoint but require a Certificate-based auth)
- Certificate
- Username/Password
- Managed identity
Index ¶
- type AuthCnfg
- func (c *AuthCnfg) GetAuth() (string, int64, error)
- func (c *AuthCnfg) GetSiteURL() string
- func (c *AuthCnfg) GetStrategy() string
- func (c *AuthCnfg) ParseConfig(byteValue []byte) error
- func (c *AuthCnfg) ReadConfig(privateFile string) error
- func (c *AuthCnfg) SetAuth(req *http.Request, httpClient *gosip.SPClient) error
- func (c *AuthCnfg) SetMasterkey(masterKey string)
- func (c *AuthCnfg) WriteConfig(privateFile string) error
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 Env map[string]string `json:"env"` // AZURE_ environment variables // contains filtered or unexported fields }
AuthCnfg - AAD Environment-Based Auth Flow No creds settings in auth config are required, the configuration is happening through environment variables: https://docs.microsoft.com/en-us/azure/developer/go/azure-sdk-authorization#use-environment-based-authentication
Config sample:
{ "siteUrl": "https://contoso.sharepoint.com/sites/test" }
func (*AuthCnfg) GetSiteURL ¶
GetSiteURL gets SharePoint siteURL
func (*AuthCnfg) GetStrategy ¶
GetStrategy gets auth strategy name
func (*AuthCnfg) ParseConfig ¶
ParseConfig parses credentials from a provided JSON byte array content
func (*AuthCnfg) ReadConfig ¶
ReadConfig reads private config with auth options
func (*AuthCnfg) SetMasterkey ¶
SetMasterkey defines custom masterkey
func (*AuthCnfg) WriteConfig ¶
WriteConfig writes private config with auth options