odrvcookie

package
v3.22.1 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2023 License: AGPL-3.0 Imports: 12 Imported by: 1

Documentation

Overview

Package odrvcookie can fetch authentication cookies for a sharepoint webdav endpoint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCookie

func GetCookie(username, password, siteUrl string) (string, error)

Types

type CookieAuth

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

CookieAuth hold the authentication information These are username and password as well as the authentication endpoint

func New

func New(pUser, pPass, pEndpoint string) CookieAuth

New creates a new CookieAuth struct

func (*CookieAuth) Cookies

func (ca *CookieAuth) Cookies() (CookieResponse, error)

Cookies creates a CookieResponse. It fetches the auth token and then retrieves the Cookies

type CookieResponse

type CookieResponse struct {
	RtFa    http.Cookie
	FedAuth http.Cookie
}

CookieResponse contains the requested cookies

type SuccessResponse

type SuccessResponse struct {
	XMLName xml.Name            `xml:"Envelope"`
	Succ    SuccessResponseBody `xml:"Body"`
}

SuccessResponse hold a response from the sharepoint webdav

type SuccessResponseBody

type SuccessResponseBody struct {
	XMLName xml.Name
	Type    string    `xml:"RequestSecurityTokenResponse>TokenType"`
	Created time.Time `xml:"RequestSecurityTokenResponse>Lifetime>Created"`
	Expires time.Time `xml:"RequestSecurityTokenResponse>Lifetime>Expires"`
	Token   string    `xml:"RequestSecurityTokenResponse>RequestedSecurityToken>BinarySecurityToken"`
}

SuccessResponseBody is the body of a success response, it holds the token

Jump to

Keyboard shortcuts

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