Skip to content

Commit 234a408

Browse files
fix:replace 'Bearer ' to ' '
Signed-off-by: Jerrico Dela Cruz <jerri_tan@outlook.com>
1 parent 708e31f commit 234a408

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/goapp/service/authenticator/authenticator-service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ func NewAuthenticatorService(conf config.ConfigManager, session session.ConnectS
5555
}
5656

5757
func (a *authenticatorService) AccessTokenIsValid(r *http.Request) bool {
58-
tokenString := strings.Split(r.Header.Get("Authorization"), "Bearer ")[1]
58+
log.Println("Validating access token: ", r.Header.Get("Authorization"))
59+
tokenString := strings.Replace(r.Header.Get("Authorization"), "Bearer ", "", 1)
5960
keySet, err := jwk.Fetch(r.Context(), "https://login.microsoftonline.com/common/discovery/v2.0/keys")
6061
if err != nil {
6162
log.Println(err.Error())

0 commit comments

Comments
 (0)