Skip to content

Commit e6de89b

Browse files
committed
Prevented secret key from being exposed to the client
1 parent 871160c commit e6de89b

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

azure_ad_configure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Template.configureLoginServiceDialogForAzureAd.helpers({
77
Template.configureLoginServiceDialogForAzureAd.fields = function () {
88
return [
99
{property: 'clientId', label: 'Client ID'},
10-
{property: 'clientSecret', label: 'Client Secret'},
10+
{property: 'secret', label: 'Client Secret'},
1111
{property: 'tennantId', label: 'Tennant Id'}
1212
];
1313
};

azure_ad_server.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ OAuth.registerService('azureAd', 2, null, function(query) {
4242
var options = {
4343
profile: {
4444
name: identity.displayName
45-
},
46-
emails : [{
45+
}
46+
};
47+
48+
if (!!emailAddress){
49+
options.emails = [{
4750
address : emailAddress,
4851
verified: true
49-
}]
50-
};
52+
}];
53+
}
5154
return { serviceData: serviceData, options: options };
5255
});
5356

@@ -63,7 +66,7 @@ var getTokens = function (query) {
6366
params: {
6467
client_id: config.clientId,
6568
grant_type: 'authorization_code',
66-
client_secret : OAuth.openSecret(config.clientSecret),
69+
client_secret : OAuth.openSecret(config.secret),
6770
resource: "https://graph.windows.net",
6871
redirect_uri: OAuth._redirectUri('azureAd', config),
6972
code: query.code

package.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
summary: "Azure Active Directory OAuth flow",
3-
version: "0.2.0",
3+
version: "0.2.1",
44
name: "wiseguyeh:azure-active-directory",
55
git: "https://github.com/djluck/azure-active-directory"
66
});

0 commit comments

Comments
 (0)