Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit c2749c0

Browse files
committed
Issue JWT, provide JWKS endpoint, ...
1 parent c121d70 commit c2749c0

15 files changed

Lines changed: 439 additions & 18 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
keys/*.pem
12
.DS_Store
23
._*
34
node_modules/

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
# stecker-auth
22

3-
Simple Auth server
3+
Simple Auth server with JWT
4+
5+
6+
## Installation and start
7+
8+
```bash
9+
npm install
10+
npm run build
11+
npm start
12+
```
13+
14+
Do not forget to provide RSA keys (see below).
15+
16+
## Generating RSA key pair
17+
18+
JWT tokens are signed with the asymmetric `RS256` algorithm.
19+
We need to provide an RSA key pair for that:
20+
21+
```bash
22+
openssl genpkey -algorithm RSA -out keys/private.pem -pkeyopt rsa_keygen_bits:2048
23+
openssl rsa -pubout -in keys/private.pem -out keys/public.pem
24+
```
25+
26+
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,5 @@ export const config = {
1515
admindn : '',
1616
adminpw : ''
1717
},
18-
tokenLifetime: 3600,
19-
secret: 'loremipsum' // secret the access token is signed with
18+
tokenLifetime: 3600
2019
}

config.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import * as path from 'path';
2+
3+
export const config = {
4+
port: 3000,
5+
mysqlCred: {
6+
host: 'pma.srv3.malcher-server.de',
7+
user: 'lagersystem',
8+
password: 'hZgF59CO9YmKJIlF4ST9tR',
9+
database: 'steckeroauth'
10+
},
11+
ldap: {
12+
server : 'localhost',
13+
port : 11389,
14+
basedn : 'dc=club,dc=hft-leipzig,dc=de',
15+
userbase : 'ou=users',
16+
groupbase: 'ou=groups',
17+
admindn : 'cn=cisauth,ou=system,dc=club,dc=hft-leipzig,dc=de',
18+
adminpw : 'hJNJbK6Gvhjf3vRZjFV4h8jGdtKJ'
19+
},
20+
tokenLifetime: 3600,
21+
keys: {
22+
private: path.join(__dirname, 'keys', 'private.pem'),
23+
public: path.join(__dirname, 'keys', 'public.pem')
24+
}
25+
}

keys/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)