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 3 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 @@ -15,20 +15,45 @@ angular.module('todoApp', ['ngRoute', 'MsalAngular'])
}).otherwise({redirectTo: "/Home"});

window.applicationConfig = {
clientID: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
clientID: '762eb4c6-0597-4585-a3cb-198827bdef0c'
chenrujun marked this conversation as resolved.
Show resolved Hide resolved
};

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: "762eb4c6-0597-4585-a3cb-198827bdef0c",
authority: "https://login.microsoftonline.com/7bf345ec-5c80-41a1-94ad-07ff910be5d8",
chenrujun marked this conversation as resolved.
Show resolved Hide resolved
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