Documentation ¶
Index ¶
- Variables
- func AcquireCredentialToken() (string, error)
- func AcquirePublicToken(account, password string) (string, error)
- func Init()
- func InitCredentialClient() (*msgraphsdk.GraphServiceClient, error)
- func InitPublicClient(account, password string) (*msgraphsdk.GraphServiceClient, error)
- func QueryAndSave(account string) (*models.User, error)
- func QueryMailAndSave(email string) (*models.User, error)
- func QueryUserPhotoById(userId, token string) string
- func QueryUserPhotoByName(username, token string) string
- type AuthReply
- type QueryReply
Constants ¶
This section is empty.
Variables ¶
View Source
var ( AzureADAppClientId string AzureADAppClientSecret string AzureADTenantId = "" AzureADTenantAuthority = "" AzureADAccountPrimaryDomain = "" AzureADCloudInstance = "https://login.microsoftonline.com" AzureADApiUsersPath = "https://graph.microsoft.com/v1.0/users" AzureADApiPublicScopes = []string{"User.Read"} AzureADApiCredentialScopes = []string{"https://graph.microsoft.com/.default"} AppLogoutRedirectUrl = "/login" )
Functions ¶
func AcquireCredentialToken ¶
func AcquirePublicToken ¶
func InitCredentialClient ¶
func InitCredentialClient() (*msgraphsdk.GraphServiceClient, error)
func InitPublicClient ¶
func InitPublicClient(account, password string) (*msgraphsdk.GraphServiceClient, error)
func QueryUserPhotoById ¶
func QueryUserPhotoByName ¶
Types ¶
type AuthReply ¶
type AuthReply struct { IsAuthenticated bool Error string Account string Name string First string Last string Email string Depart string Avatar string }
func AuthenticatePublicClient ¶
Authenticate do auth and return Auth object including user information and lognin success or not Required Delegated Permission: User.Read, and Grant admin consent as this is a Daemon web api. account could be the pricipal user name in AAD or mail of login user
Click to show internal directories.
Click to hide internal directories.