Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dex
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
dex
Commits
ea2f0a32
Commit
ea2f0a32
authored
Jun 13, 2016
by
Eric Chiang
Committed by
GitHub
Jun 13, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #466 from zlabjp/update-go-oidc
vendor: update go-oidc to add support for Azure AD
parents
868f5322
316953d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
16 deletions
+30
-16
glide.lock
glide.lock
+3
-3
glide.yaml
glide.yaml
+1
-1
oauth2.go
vendor/github.com/coreos/go-oidc/oauth2/oauth2.go
+12
-12
oauth2_test.go
vendor/github.com/coreos/go-oidc/oauth2/oauth2_test.go
+14
-0
No files found.
glide.lock
View file @
ea2f0a32
hash:
7e7b258be2aa7e03d1bb15c96f856a9b7982d850a1faeba699a0b11bcb0c6936
updated: 2016-0
5-27T00:22:02.656877293+02
:00
hash:
af5ee807138ecd53eebc54567b4dcd66e3a6ddc7d758fb9f34e6e3eb13b20cf2
updated: 2016-0
6-13T10:58:04.608971954+09
:00
imports:
- name: github.com/andybalholm/cascadia
version: 6122e68c2642b7b75c538a63b15168c6c80fb757
- name: github.com/coreos/go-oidc
version:
e6174c764e906bd60c76fdfc33faf5e0bdc875d6
version:
8ae400b75540a4f57ec549a89b3e9d994c636f2a
subpackages:
- http
- jose
...
...
glide.yaml
View file @
ea2f0a32
...
...
@@ -5,7 +5,7 @@ import:
-
package
:
github.com/andybalholm/cascadia
version
:
6122e68c2642b7b75c538a63b15168c6c80fb757
-
package
:
github.com/coreos/go-oidc
version
:
e6174c764e906bd60c76fdfc33faf5e0bdc875d6
version
:
8ae400b75540a4f57ec549a89b3e9d994c636f2a
subpackages
:
-
http
-
jose
...
...
vendor/github.com/coreos/go-oidc/oauth2/oauth2.go
View file @
ea2f0a32
...
...
@@ -332,16 +332,16 @@ func parseTokenResponse(resp *http.Response) (result TokenResponse, err error) {
result
.
Scope
=
vals
.
Get
(
"scope"
)
}
else
{
var
r
struct
{
AccessToken
string
`json:"access_token"`
TokenType
string
`json:"token_type"`
IDToken
string
`json:"id_token"`
RefreshToken
string
`json:"refresh_token"`
Scope
string
`json:"scope"`
State
string
`json:"state"`
ExpiresIn
int
`json:"expires_in"`
Expires
int
`json:"expires"`
Error
string
`json:"error"`
Desc
string
`json:"error_description"`
AccessToken
string
`json:"access_token"`
TokenType
string
`json:"token_type"`
IDToken
string
`json:"id_token"`
RefreshToken
string
`json:"refresh_token"`
Scope
string
`json:"scope"`
State
string
`json:"state"`
ExpiresIn
json
.
Number
`json:"expires_in"`
// Azure AD returns string
Expires
int
`json:"expires"`
Error
string
`json:"error"`
Desc
string
`json:"error_description"`
}
if
err
=
json
.
Unmarshal
(
body
,
&
r
);
err
!=
nil
{
return
...
...
@@ -355,10 +355,10 @@ func parseTokenResponse(resp *http.Response) (result TokenResponse, err error) {
result
.
IDToken
=
r
.
IDToken
result
.
RefreshToken
=
r
.
RefreshToken
result
.
Scope
=
r
.
Scope
if
r
.
ExpiresIn
==
0
{
if
expiresIn
,
err
:=
r
.
ExpiresIn
.
Int64
();
err
!=
nil
{
result
.
Expires
=
r
.
Expires
}
else
{
result
.
Expires
=
r
.
ExpiresIn
result
.
Expires
=
int
(
expiresIn
)
}
}
return
...
...
vendor/github.com/coreos/go-oidc/oauth2/oauth2_test.go
View file @
ea2f0a32
...
...
@@ -438,6 +438,20 @@ func TestParseTokenResponse(t *testing.T) {
RefreshToken
:
"spam"
,
},
},
{
// Azure AD returns "expires_in" value as string
resp
:
response
{
body
:
`{"access_token":"foo","id_token":"bar","expires_in":"300","token_type":"bearer","refresh_token":"spam"}`
,
contentType
:
"application/json; charset=utf-8"
,
},
wantResp
:
TokenResponse
{
AccessToken
:
"foo"
,
IDToken
:
"bar"
,
Expires
:
300
,
TokenType
:
"bearer"
,
RefreshToken
:
"spam"
,
},
},
{
resp
:
response
{
body
:
`{"access_token":"foo","id_token":"bar","expires":200,"token_type":"bearer","refresh_token":"spam"}`
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment