Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified assets/callback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/consent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/oauth-config.png
Binary file not shown.
Binary file modified assets/shared-identity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16,044 changes: 10,824 additions & 5,220 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@digipolis/auth",
"version": "2.3.2",
"version": "2.3.4",
"description": "",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,10 @@ After creating your application on the api store, you should create a contract w
and the Consent API (if you want to enable SSO)
![Create Contract consent](/assets/consent.png "Create contract consent")

The next step is to navigate to your applications and clicking on actions
The next step is to navigate to your applications in the publisher and clicking on Instellingen > Client Keys > `<environment>`

![actions](/assets/oauth-config.png "actions")


Click on oauth2 config. You'll find your clientId and secret here.
You'll find your clientId and secret here.

![configure callback](/assets/callback.png "callback")

Expand Down Expand Up @@ -259,7 +257,7 @@ after logout.
| Name | Assurance level | Context | Description |
| --------------------- | --------------- | -----------|--------------------------------------------------------------- |
| iam-aprofiel-userpass | low | citizen | Our default aprofiel authentication with username and password |
| iam-aprofiel-phone | low | citizen | Our aprofiel authentication with phone and code |
| iam-aprofiel-phone | low | citizen | Our aprofiel authentication with phone and code |
| fas-citizen-bmid | substantial | citizen | Belgian Mobile ID (e.g. Itsme) |
| fas-citizen-otp | substantial | citizen | Authentication with one time password (e.g. sms) |
| fas-citizen-totp | substantial | citizen | Time-based one time password (e.g. Google Authenticator) |
Expand Down
2 changes: 2 additions & 0 deletions src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ export default function createController(config) {
} = options;

if (auth_methods && auth_methods.length > 0) {
auth_methods = auth_methods.replace('astad.aprofiel.v1', 'iam-aprofiel-userpass');
return auth_methods;
}

if (!['citizen', 'enterprise', 'enterprise-citizen'].includes(context)) {
logger.info(`context ${context} not known, fallback to citizen`);
context = 'citizen';
Expand Down
35 changes: 35 additions & 0 deletions test/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,41 @@ describe('GET /login', function onDescribe() {
router.handle(req, res);
});

it('should replace auth method "astad.aprofiel.v1" with "iam-aprofiel-userpass"', function onIt(done) {
const router = createRouter(mockExpress, correctConfig);
const host = 'http://www.app.com';
let redirectUrl = false;

const req = reqres.req({
url: '/auth/login',
query: {
auth_methods: 'astad.aprofiel.v1'
},
get: () => host,
session: {
save: (cb) => cb(),
},
});

const res = reqres.res({
header: () => { },
redirect(val) {
redirectUrl = val
this.emit('end');
}
});

res.redirect.bind(res);

res.on('end', () => {
assert(redirectUrl);
assert(redirectUrl.includes('auth_methods=iam-aprofiel-userpass'));
return done();
});

router.handle(req, res);
});

it('should redirect to login with extra scopes if scopeGroups query param is supplied', function onIt(done) {
const config = Object.assign({}, correctConfig, {
scopeGroups: {
Expand Down