getBearerTokenFromAuthorizationHeader()
Home > @backstage/plugin-auth-node > getBearerTokenFromAuthorizationHeader
Warning: This API is now obsolete.
Use the
credentialsmethod ofHttpAuthServicefrom@backstage/backend-plugin-apiinstead
Parses the given authorization header and returns the bearer token, or undefined if no bearer token is given.
Signature:
function getBearerTokenFromAuthorizationHeader(authorizationHeader: unknown): string | undefined;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
authorizationHeader |
unknown |
string | undefined
Remarks
This function is explicitly built to tolerate bad inputs safely, so you may call it directly with e.g. the output of req.header('authorization') without first checking that it exists.