graph

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthResponse

type AuthResponse struct {
	TokenType string `json:"token_type"`
	Expires   int    `json:"expires_in"`
	Token     string `json:"access_token"`
}

AuthResponse represents a response from the MS Graph auth API

type Group

type Group struct {
	Name string `json:"displayName"`
	ID   string `json:"id"`
}

Group represents the Group object from the MSGraphAPI

type GroupList

type GroupList struct {
	Value []Group `json:"value"`
}

GroupList represents a list of groups returned from the MS Graph API

type ObjectList

type ObjectList struct {
	Value []string `json:"value"`
}

ObjectList represents a list of directory object IDs returned from the MS Graph API

type ObjectQuery

type ObjectQuery struct {
	IDs   []string `json:"ids"`
	Types []string `json:"types"`
}

ObjectQuery represents a query object to the directoryObjects endpoint

type UserInfo

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

UserInfo allows you to get user data from MS Graph

func New

func New(clientID, clientSecret, tenantName string) (*UserInfo, error)

New returns a new UserInfo object that is authenticated to the MS Graph API. If authentication fails, an error will be returned

func (*UserInfo) GetGroups

func (u *UserInfo) GetGroups(userPrincipal string) ([]string, error)

GetGroups gets a list of all groups that the given user principal is part of Generally in federated directories the email address is the userPrincipalName

func (*UserInfo) Name

func (u *UserInfo) Name() string

Name returns the name of this getter

Jump to

Keyboard shortcuts

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