saml

package
v0.1.34 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package saml implements SAML Auth (SharePoint Online user credentials authentication)

This authentication option uses Microsoft Online Security Token Service `https://login.microsoftonline.com/extSTS.srf` and SAML tokens in order to obtain authentication cookie.

Amongst supported platform versions are:

  • SharePoint Online (SPO)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAuth

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

GetAuth gets authentication

Types

type AuthCnfg

type AuthCnfg struct {
	SiteURL  string `json:"siteUrl"`  // SPSite or SPWeb URL, which is the context target for the API calls
	Username string `json:"username"` // Username for SharePoint Online, for example `[user]@[company].onmicrosoft.com`
	Password string `json:"password"` // User or App password
	// contains filtered or unexported fields
}

AuthCnfg - SAML auth config structure

SharePoint Online config sample:
{
  "siteUrl": "https://contoso.sharepoint.com/sites/test",
  "username": "john.doe@contoso.onmicrosoft.com",
  "password": "this-is-not-a-real-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 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 : authenticate 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