Documentation ¶
Overview ¶
Package addin implements AddIn Only Auth
This type of authentication uses AddIn Only policy and OAuth bearer tokens for authenticating HTTP requests.
Amongst supported platform versions are:
- SharePoint Online (SPO)
Index ¶
- func GetAuth(ctx context.Context, c *AuthCnfg) (string, int64, error)
- type AuthCnfg
- func (c *AuthCnfg) GetAuth(ctx context.Context) (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 ¶
Types ¶
type AuthCnfg ¶
type AuthCnfg struct { SiteURL string `json:"siteUrl"` // SPSite or SPWeb URL, which is the context target for the API calls ClientID string `json:"clientId"` // Client ID obtained when registering the AddIn ClientSecret string `json:"clientSecret"` // Client Secret obtained when registering the AddIn Realm string `json:"realm"` // Your SharePoint Online tenant ID (optional) // contains filtered or unexported fields }
AuthCnfg - AddIn Only auth config structure
SharePoint Online config sample:
{ "siteUrl": "https://contoso.sharepoint.com/sites/test", "clientId": "e2763c6d-7ee6-41d6-b15c-dd1f75f90b8f", "clientSecret": "OqDSAAuBChzI+uOX0OUhXxiOYo1g6X7mjXCVA9mSF/0=" }
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
Click to show internal directories.
Click to hide internal directories.