Twitch Oauth User Retrieval 401 with Spring Boot 2+

Alright guys, I have fixed my problem. The problem is that when you request access token from twitch using client id an secret with authorization_code, you will get the token with lower case “bearer” as name/type. If you are using spring, by default, spring will use whatever name/type that’s given, or it will set to “Bearer” if no name/type is given. In this case, however, the lower case “bearer” is given by twitch.

But if you use “bearer” along with the access token value to get user details (https://api.twitch.tv/helix/users), you will get “401” because this endpoint (could be other endpoints) only accept “Bearer” as token name/type. Only the camel case “Bearer” goes through. The lower case “bearer” will get your “401 Unauthorized”.

Apparently this has never happened before, it could be a recent change but this feels like a bug to me. Could someone else confirm this for me? Thanks in advance.