Skip to content

Commit

Permalink
Expose authorization header parser (#152559)
Browse files Browse the repository at this point in the history
Resolves #152116

## Summary

Exposes HTTPAuthorizationHeader interface to allow extracting
credentials from request headers.

## Example

```ts
import { HTTPAuthorizationHeader } from '@kbn/security-plugin/server';

HTTPAuthorizationHeader.parseFromRequest(request);
```

Returns the following object:

```
HTTPAuthorizationHeader {
  scheme: 'ApiKey',
  credentials: 'ZmhPUm5JWUItbEhKWktnU2VjWlY6TF9CSDB1c3JSd1NsZkNzZ3kzMnNpdw=='
}
```
  • Loading branch information
thomheymann authored Mar 7, 2023
1 parent 4c67794 commit 9a67404
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions x-pack/plugins/security/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type {
ValidateAPIKeyParams,
AuthenticationServiceStart,
} from './authentication';
export { HTTPAuthorizationHeader } from './authentication';
export type { CheckPrivilegesPayload, CasesSupportedOperations } from './authorization';
export type AuthorizationServiceSetup = SecurityPluginStart['authz'];
export type { AuditLogger, AuditEvent, AuditHttp, AuditKibana, AuditRequest } from './audit';
Expand Down

0 comments on commit 9a67404

Please sign in to comment.