Skip to content
This repository was archived by the owner on Mar 3, 2022. It is now read-only.
This repository was archived by the owner on Mar 3, 2022. It is now read-only.

Bearer token type casing? #1392

Open
Open
@samuel99

Description

@samuel99

First of. This is my first time implementing OIDC, have that in mind when reading the following, my terminology might be wrong.

So, I'm using the oidc-client library to connect to an auth server from an Angular app. When I try to authenticate to an API, I append the authorization headers like so:

  getAuthorizationHeaderValue(): string {
    return `${this.user.token_type} ${this.user.id_token}`;
  }

The request looks like this:

image

The server does not accept bearer to be in lowercase. If I change to Bearer it works:

  getAuthorizationHeaderValue(): string {
    return `${this.capitalizeFirstLetter(this.user.token_type)} ${this.user.id_token}`;
  }
  capitalizeFirstLetter(string: string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
  }

But this doesn't feel right?

If I look at the IETF spec it says:
image
https://tools.ietf.org/id/draft-ietf-oauth-v2-bearer-13.xml#rfc.section.5.1.1

Am I doing something wrong here? Can I change it to be Bearer instead of bearer?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions