
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
angular-auth-bearer-token
Advanced tools
[](https://travis-ci.org/matmar10/angular-auth-bearer-token)
AKA RFC 6750: https://tools.ietf.org/html/rfc6750
A simple an unobtrusive way to add bearer token authentication strategy to your angular project.
Install via Bower:
bower install angular-auth-bearer-token --save
Require the module in your app:
angular.module('yourApp', ['auth.bearer-token']);
An HTTP interceptor will automatically store the authorization header from
any request with an Authorization
header.
Future requests will always include the authorization token.
The following events are emitted via $emit
on $rootScope
:
auth:session-start
- triggered when a token gets stored but no previous token existedauth:session-end
- triggered when the token is clearedauth:session-update
- triggered when a new token is storedFor auth:session-start
and auth:session-update
, the HTTP configuration
is passed to the handler:
$rootScope.$on('auth:session-start', function (ev, response) {
// logs the HTTP body returned that triggered the session start event
$log.debug('The data from session start is:', response.body);
});
header
[default: Authorization
] - What header should be checked/set for requestslog
[default: debug
] - Log level for logging; set to false
to disabletokenRegex
[default: /Bearer/
] - Regular expression to check if returned authorization header is suitableangular.module('myApp').config(function ('authBearerTokenHttpInterceptorProvider') {
authBearerTokenHttpInterceptorProvider.configure({
log: false
});
});
angular.module('myApp').config(function ('authBearerTokenHttpInterceptorProvider') {
authBearerTokenHttpInterceptorProvider.configure({
// look/set `Auth` header
header: 'Auth',
// match anything
tokenRegex: /[\s\S]*
});
});
Clone it:
git clone https://github.com/matmar10/angular-auth-bearer-token.git
Install deps:
npm install && bower install
Test it:
grunt test
Please adhere to JSHint code quality standard as specified in .jshintrc
$cookies
APIdebug
to allow supression in client appsFAQs
[](https://travis-ci.org/matmar10/angular-auth-bearer-token)
The npm package angular-auth-bearer-token receives a total of 8 weekly downloads. As such, angular-auth-bearer-token popularity was classified as not popular.
We found that angular-auth-bearer-token demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.