Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
daas
jwt-tokenissuer
Commits
28efdf35
Commit
28efdf35
authored
Oct 16, 2018
by
Gurvinder Singh
Browse files
update token issuer to use RAWURLEncoding and return json coding to configuration as well
parent
4a9b37ad
Pipeline
#11852
passed with stages
in 1 minute and 2 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
openid_config.go
View file @
28efdf35
...
...
@@ -41,6 +41,7 @@ func getOpenIDConfig() *OpenIDConfig {
func
(
oidcConf
*
OpenIDConfig
)
openidConfigHandler
()
http
.
Handler
{
return
http
.
HandlerFunc
(
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/json"
)
encoder
:=
json
.
NewEncoder
(
w
)
encoder
.
Encode
(
oidcConf
)
})
...
...
openid_jwks.go
View file @
28efdf35
...
...
@@ -16,7 +16,6 @@ type Key struct {
KType
string
`json:"kty"`
N
string
`json:"n"`
E
string
`json:"e"`
Key
string
`json:"x5c"`
}
type
JWKS
struct
{
...
...
@@ -39,9 +38,8 @@ func getJWKS() *JWKS {
e
=
make
([]
byte
,
4
)
binary
.
BigEndian
.
PutUint32
(
e
,
uint32
(
rsaKey
.
E
))
key
:=
Key
{
KType
:
"RSA"
,
Key
:
base64
.
URLEncoding
.
EncodeToString
(
keyBytes
),
N
:
base64
.
URLEncoding
.
EncodeToString
(
rsaKey
.
N
.
Bytes
()),
E
:
base64
.
URLEncoding
.
EncodeToString
(
e
)}
N
:
base64
.
RawURLEncoding
.
EncodeToString
(
rsaKey
.
N
.
Bytes
()),
E
:
base64
.
RawURLEncoding
.
EncodeToString
(
e
)}
return
&
JWKS
{
Keys
:
[]
Key
{
key
}}
}
...
...
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