Skip to content

Commit f84db50

Browse files
Add user attributes and groups to SSO
1 parent 72f5624 commit f84db50

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ app.use(function(req, res, next){
4848
// dummy database
4949

5050
var users = [
51-
{ firstName: 'Rene', lastName: 'Mueller', email: '[email protected]' },
52-
{ firstName: 'Cecilia', lastName: 'Stark', email: '[email protected]'}
51+
{ firstName: 'Rene', lastName: 'Mueller', email: '[email protected]', accountId: 28, accountName: 'Customer-Acme' },
52+
{ firstName: 'Cecilia', lastName: 'Stark', email: '[email protected]', accountId: 132, accountName: 'Customer-Fake'}
5353
];
5454

5555
// when you create a user, generate a salt
@@ -102,6 +102,8 @@ const signUserToken = user =>
102102
email: user.email,
103103
first_name: user.firstName,
104104
last_name: user.lastName,
105+
account_id: user.accountId,
106+
groups: [user.accountName],
105107
exp: Math.round(Date.now() / 1000) + 60 * 10, // 10 minute expiration
106108
},
107109
METABASE_JWT_SHARED_SECRET

0 commit comments

Comments
 (0)