Skip to content

Commit 3e2e084

Browse files
GorshkovIvanIvan Gorshkov
andauthored
bearer token endpoint (#34)
Co-authored-by: Ivan Gorshkov <[email protected]>
1 parent b7bf47c commit 3e2e084

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/clientcredentials/service.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ func HandleTokenRequest(w http.ResponseWriter, r *http.Request) {
8787
return
8888
}
8989

90+
tokenType := r.URL.Query().Get("token_type")
91+
if tokenType == "" {
92+
tokenType = "Bearer" // default
93+
}
94+
9095
accessToken := firstAccessToken
9196

9297
_, ok := state.Load(clientSecret)
@@ -106,7 +111,7 @@ func HandleTokenRequest(w http.ResponseWriter, r *http.Request) {
106111

107112
response := tokenResponse{
108113
AccessToken: accessToken,
109-
TokenType: "Bearer",
114+
TokenType: tokenType,
110115
ExpiresIn: 0,
111116
}
112117

0 commit comments

Comments
 (0)