Skip to content

Commit

Permalink
Add note for authPrefix. Closes #124.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenkie authored Nov 17, 2016
1 parent e60900e commit 12cfa3d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,28 @@ angular
});
```

### Configuring the Authentication Scheme

By default, angular-jwt uses the `Bearer` scheme when sending JSON Web Tokens as an `Authorization` header. The header that gets attached to `$http` requests looks like this:

```
Authorization: Bearer eyJ0eXAiOiJKV...
```

If you would like to provide your own scheme, you can configure it by setting a value for `authPrefix` in the `jwtOptionsProvider` configuration.

```js
angular
.module('app', ['angular-jwt'])
.config(function Config($httpProvider, jwtOptionsProvider) {
jwtOptionsProvider.config({
authPrefix: 'MyPrefix '
...
});

$httpProvider.interceptors.push('jwtInterceptor');
```
### Not Sending the JWT for Specific Requests
```js
Expand Down

0 comments on commit 12cfa3d

Please sign in to comment.