diff options
author | Kevin Lyda <kevin@ie.suberic.net> | 2018-08-10 17:21:02 +0000 |
---|---|---|
committer | Niall Sheridan <nsheridan@gmail.com> | 2018-08-10 18:21:02 +0100 |
commit | 3e006c39b0a4411e91e80de261d0e7b5353d44c0 (patch) | |
tree | 57754a0a8b80200eede4d6e5a8c1ae7621a3f393 /vendor | |
parent | 99a01f63f51b73f103cd1e094f1a8e7f35d9d30b (diff) |
Add Microsoft auth provider
Microsoft uses JSON Web Tokens (JWT) as OAuth tokens. These can run to many thousands of characters which are too long for TTYs. Work around this by base64-encoding the token and chunk it into smaller pieces.
Closes #70
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/golang.org/x/oauth2/microsoft/microsoft.go | 31 | ||||
-rw-r--r-- | vendor/vendor.json | 6 |
2 files changed, 37 insertions, 0 deletions
diff --git a/vendor/golang.org/x/oauth2/microsoft/microsoft.go b/vendor/golang.org/x/oauth2/microsoft/microsoft.go new file mode 100644 index 0000000..3ffbc57 --- /dev/null +++ b/vendor/golang.org/x/oauth2/microsoft/microsoft.go @@ -0,0 +1,31 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package microsoft provides constants for using OAuth2 to access Windows Live ID. +package microsoft // import "golang.org/x/oauth2/microsoft" + +import ( + "golang.org/x/oauth2" +) + +// LiveConnectEndpoint is Windows's Live ID OAuth 2.0 endpoint. +var LiveConnectEndpoint = oauth2.Endpoint{ + AuthURL: "https://login.live.com/oauth20_authorize.srf", + TokenURL: "https://login.live.com/oauth20_token.srf", +} + +// AzureADEndpoint returns a new oauth2.Endpoint for the given tenant at Azure Active Directory. +// If tenant is empty, it uses the tenant called `common`. +// +// For more information see: +// https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints +func AzureADEndpoint(tenant string) oauth2.Endpoint { + if tenant == "" { + tenant = "common" + } + return oauth2.Endpoint{ + AuthURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/authorize", + TokenURL: "https://login.microsoftonline.com/" + tenant + "/oauth2/v2.0/token", + } +} diff --git a/vendor/vendor.json b/vendor/vendor.json index aca060d..1b1f6cf 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -979,6 +979,12 @@ "revisionTime": "2018-06-20T17:47:24Z" }, { + "checksumSHA1": "91mzAbqHQ6AAK65DzB4IkLOcvtk=", + "path": "golang.org/x/oauth2/microsoft", + "revision": "ef147856a6ddbb60760db74283d2424e98c87bff", + "revisionTime": "2018-06-20T17:47:24Z" + }, + { "checksumSHA1": "S0DP7Pn7sZUmXc55IzZnNvERu6s=", "path": "golang.org/x/sync/errgroup", "revision": "1d60e4601c6fd243af51cc01ddf169918a5407ca", |