Skip to content

Commit

Permalink
chore: update doc
Browse files Browse the repository at this point in the history
update doc
  • Loading branch information
emonddr committed Apr 29, 2019
1 parent cf43d79 commit 6096b8b
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions packages/authentication/docs/authentication-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,20 @@ And the abstractions for:
## Registering an authentication strategy via an extension point

Authentication strategies register themselves to an authentication strategy
resolver using an
provider using an
[ExtensionPoint/Extension Pattern](https://wiki.eclipse.org/FAQ_What_are_extensions_and_extension_points%3F)
as described in the
[Greeter extension example](https://github.com/strongloop/loopback-next/tree/master/examples/greeter-extension).

The `AuthenticationStrategyProvider` class in
`src/providers/auth-strategy.provider.ts` declares an `extension point` named
`src/providers/auth-strategy.provider.ts` (shown below) declares an `extension point` named
`AuthenticationBindings.AUTHENTICATION_STRATEGY_EXTENSION_POINT_NAME` via the
`@extensionPoint` decorator. `AuthenticationStrategyProvider` is responsible for
returning an authentication strategy which has a specific **name** and has been
registered as an **extension** of the aforementioned **extension point** with
the aid of the `@extensions()` decorator. The binding scope is set to
**transient** because an authentication strategy **may** differ with each
request.
`@extensionPoint` decorator. The binding scope is set to **transient** because
an authentication strategy **may** differ with each request.
`AuthenticationStrategyProvider` is responsible for finding (with the aid of the
`@extensions()` **getter** decorator) and returning an authentication strategy
which has a specific **name** and has been registered as an **extension** of the
aforementioned **extension point**.

```ts
@extensionPoint(
Expand Down Expand Up @@ -265,10 +265,10 @@ export class BasicAuthenticationStrategy implements AuthenticationStrategy {
}
```
A custom sequence must be created to insert `AuthenticationBindings.AUTH_ACTION`
action. The `AuthenticateFn` function interface is implemented by the `value()`
function of `AuthenticateActionProvider` class in
`src/providers/authentication.provider.ts`. **( New name TBD)**
A custom sequence must be created to insert the
`AuthenticationBindings.AUTH_ACTION` action. The `AuthenticateFn` function
interface is implemented by the `value()` function of
`AuthenticateActionProvider` class in `/src/providers/auth-action.provider.ts`.

```ts
class SequenceIncludingAuthentication implements SequenceHandler {
Expand Down Expand Up @@ -327,7 +327,7 @@ class SequenceIncludingAuthentication implements SequenceHandler {
```
Then custom sequence must be bound to the application, and the authentication
strategy must be added as an extension of the extension point using the
strategy must be added as an **extension** of the **extension point** using the
`addExtension` function.
```ts
Expand Down

0 comments on commit 6096b8b

Please sign in to comment.