Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

32 righe
1.1 KiB

  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Package microsoft provides constants for using OAuth2 to access Windows Live ID.
  5. package microsoft // import "golang.org/x/oauth2/microsoft"
  6. import (
  7. "golang.org/x/oauth2"
  8. )
  9. // LiveConnectEndpoint is Windows's Live ID OAuth 2.0 endpoint.
  10. var LiveConnectEndpoint = oauth2.Endpoint{
  11. AuthURL: "https://login.live.com/oauth20_authorize.srf",
  12. TokenURL: "https://login.live.com/oauth20_token.srf",
  13. }
  14. // AzureADEndpoint returns a new oauth2.Endpoint for the given tenant at Azure Active Directory.
  15. // If tenant is empty, it uses the tenant called `common`.
  16. //
  17. // For more information see:
  18. // https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints
  19. func AzureADEndpoint(tenant string) oauth2.Endpoint {
  20. if tenant == "" {
  21. tenant = "common"
  22. }
  23. return oauth2.Endpoint{
  24. AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize",
  25. TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token",
  26. }
  27. }