Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the method of obtaining tokens from implicit flow to pkce #17530

Merged
merged 7 commits into from
Nov 13, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,40 @@ angular.module('todoApp', ['ngRoute', 'MsalAngular'])

msalProvider.init(
{
authority: 'https://login.microsoftonline.com/xxxorg.onmicrosoft.com',
clientID: applicationConfig.clientID,
cacheLocation: 'localStorage',
postLogoutRedirectUri: 'http://localhost:8080/logout',

tokenReceivedCallback: function (errorDesc, token, error, tokenType) {
auth: {
clientId: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
authority: "https://login.microsoftonline.com/xxxorg.onmicrosoft.com",
redirectUri: "http://localhost:8080/",
},
cache: {
cacheLocation: "sessionStorage", // This configures where your cache will be stored
storeAuthStateInCookie: false, // Set this to "true" if you are having issues on IE11 or Edge
},
},
system: {
loggerOptions: {
loggerCallback: (level, message, containsPii) => {
if (containsPii) {
return;
}
switch (level) {
case msal.LogLevel.Error:
console.error(message);
return;
case msal.LogLevel.Info:
console.info(message);
return;
case msal.LogLevel.Verbose:
console.debug(message);
return;
case msal.LogLevel.Warning:
console.warn(message);
return;
}
}
}
}
}
,
$httpProvider
);

}]);
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
angular.module('todoApp')
.controller('homeCtrl', ['$scope', 'msalAuthenticationService', '$location', function ($scope, msalService, $location) {
$scope.login = function () {
msalService.loginRedirect();
msalService.loginRedirect({
scopes: ["User.Read"]
});
};
$scope.logout = function () {
msalService.logout();
};
$scope.isActive = function (viewLocation) {
return viewLocation === $location.path();
};
}]);
}]);
Loading