@jitar-plugins/authentication 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ const authProcedures = {
|
|
|
39
39
|
logout: 'domain/authentication/logout'
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
// The client path to return to after a
|
|
42
|
+
// The client path to return to after a successful login
|
|
43
43
|
const redirectPath = '/afterlogin';
|
|
44
44
|
|
|
45
45
|
const whiteList: string[] = [
|
|
@@ -49,7 +49,7 @@ const whiteList: string[] = [
|
|
|
49
49
|
export default new AuthenticationMiddleware(identityProvider, authProcedures, redirectPath, whiteList);
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
The requester middleware operates on the client side (web browser) and provides auth
|
|
52
|
+
The requester middleware operates on the client side (web browser) and provides auth information with every request.
|
|
53
53
|
|
|
54
54
|
```ts
|
|
55
55
|
// src/middleware/requesterMiddleware.ts
|
|
@@ -63,7 +63,7 @@ const authorization = key !== undefined ? `Bearer ${key}` : undefined;
|
|
|
63
63
|
export default new RequesterMiddleware(authorization);
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
To make sure the client redirects to the original location after login, we also need a third middleware
|
|
66
|
+
To make sure the client redirects to the original location after login, we also need a third middleware coming from the http package.
|
|
67
67
|
|
|
68
68
|
```ts
|
|
69
69
|
// src/middleware/originMiddleware.ts
|
|
@@ -78,7 +78,7 @@ export default new OriginMiddleware();
|
|
|
78
78
|
With the middleware in place, the need to be activated.
|
|
79
79
|
|
|
80
80
|
For the server side, this means adding the authentication middleware to the service configuration.
|
|
81
|
-
This is most
|
|
81
|
+
This is most likely the proxy / standalone service.
|
|
82
82
|
|
|
83
83
|
```json
|
|
84
84
|
/* services/proxy.json */
|
|
@@ -151,7 +151,7 @@ export default async function login(identity: Identity): Promise<Requester>
|
|
|
151
151
|
export default async function logout(): Promise<void>
|
|
152
152
|
{
|
|
153
153
|
// The authentication middleware will handle the logout.
|
|
154
|
-
//
|
|
154
|
+
// Implement additional logic here.
|
|
155
155
|
}
|
|
156
156
|
```
|
|
157
157
|
|
|
@@ -169,7 +169,7 @@ The procedures need to be exposed publicly to make them acessible.
|
|
|
169
169
|
|
|
170
170
|
### Step 5 - Implement the client redirect path
|
|
171
171
|
|
|
172
|
-
This path will be called after a
|
|
172
|
+
This path will be called after a successful login with the session key.
|
|
173
173
|
|
|
174
174
|
```http
|
|
175
175
|
GET http://app.example.com/afterlogin?key=XXXXXX
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jitar-plugins/authentication",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
7
7
|
"url": "git+https://github.com/MaskingTechnology/jitar-plugins.git"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"./client": "./dist/client.js"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
|
-
"@theshelf/authentication": "^0.4.
|
|
26
|
-
"jitar": "^0.10.4"
|
|
25
|
+
"@theshelf/authentication": "^0.4.5",
|
|
26
|
+
"jitar": "^0.10.4 || ^0.11.0"
|
|
27
27
|
}
|
|
28
28
|
}
|