{"action":"created","issue":{"url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js/issues/370","repository_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js","labels_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js/issues/370/labels{/name}","comments_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js/issues/370/comments","events_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js/issues/370/events","html_url":"https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/370","id":347064423,"node_id":"MDU6SXNzdWUzNDcwNjQ0MjM=","number":370,"title":"MSAL is not cleaning up local storage","user":{"login":"freeman-g","id":495886,"node_id":"MDQ6VXNlcjQ5NTg4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/495886?v=4","gravatar_id":"","url":"https://api.github.com/users/freeman-g","html_url":"https://github.com/freeman-g","followers_url":"https://api.github.com/users/freeman-g/followers","following_url":"https://api.github.com/users/freeman-g/following{/other_user}","gists_url":"https://api.github.com/users/freeman-g/gists{/gist_id}","starred_url":"https://api.github.com/users/freeman-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeman-g/subscriptions","organizations_url":"https://api.github.com/users/freeman-g/orgs","repos_url":"https://api.github.com/users/freeman-g/repos","events_url":"https://api.github.com/users/freeman-g/events{/privacy}","received_events_url":"https://api.github.com/users/freeman-g/received_events","type":"User","site_admin":false},"labels":[{"id":990035282,"node_id":"MDU6TGFiZWw5OTAwMzUyODI=","url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js/labels/needs%20info","name":"needs info","color":"5b4cd3","default":false}],"state":"closed","locked":false,"assignee":{"login":"nehaagrawal","id":6045787,"node_id":"MDQ6VXNlcjYwNDU3ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/6045787?v=4","gravatar_id":"","url":"https://api.github.com/users/nehaagrawal","html_url":"https://github.com/nehaagrawal","followers_url":"https://api.github.com/users/nehaagrawal/followers","following_url":"https://api.github.com/users/nehaagrawal/following{/other_user}","gists_url":"https://api.github.com/users/nehaagrawal/gists{/gist_id}","starred_url":"https://api.github.com/users/nehaagrawal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nehaagrawal/subscriptions","organizations_url":"https://api.github.com/users/nehaagrawal/orgs","repos_url":"https://api.github.com/users/nehaagrawal/repos","events_url":"https://api.github.com/users/nehaagrawal/events{/privacy}","received_events_url":"https://api.github.com/users/nehaagrawal/received_events","type":"User","site_admin":false},"assignees":[{"login":"nehaagrawal","id":6045787,"node_id":"MDQ6VXNlcjYwNDU3ODc=","avatar_url":"https://avatars3.githubusercontent.com/u/6045787?v=4","gravatar_id":"","url":"https://api.github.com/users/nehaagrawal","html_url":"https://github.com/nehaagrawal","followers_url":"https://api.github.com/users/nehaagrawal/followers","following_url":"https://api.github.com/users/nehaagrawal/following{/other_user}","gists_url":"https://api.github.com/users/nehaagrawal/gists{/gist_id}","starred_url":"https://api.github.com/users/nehaagrawal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nehaagrawal/subscriptions","organizations_url":"https://api.github.com/users/nehaagrawal/orgs","repos_url":"https://api.github.com/users/nehaagrawal/repos","events_url":"https://api.github.com/users/nehaagrawal/events{/privacy}","received_events_url":"https://api.github.com/users/nehaagrawal/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-08-02T15:31:50Z","updated_at":"2018-08-04T10:25:29Z","closed_at":"2018-08-04T10:25:04Z","author_association":"NONE","body":"We use MSAL to request and renew ID tokens and Access tokens. \r\n\r\nHere's an example of how we use it:\r\n\r\n```\r\nlet userAgentApplication = new Msal.UserAgentApplication(msalGlobal.clientID, msalGlobal.authority, null, {\r\n  redirectUri: msalGlobal.redirectUri,\r\n  cacheLocation: 'localStorage',\r\n  logger: msalGlobal.logger,\r\n  postLogoutRedirectUri: msalGlobal.postLogoutRedirectUri\r\n})\r\n\r\nfunction callGraphApi() {\r\n  var user = userAgentApplication.getUser()\r\n  if (!user) {\r\n    userAgentApplication.loginRedirect(msalGlobal.graphAccessTokenScopes)\r\n  } else {\r\n    userAgentApplication.acquireTokenSilent(msalGlobal.graphIdTokenScopes)\r\n      .then((idToken) => {\r\n        userAgentApplication.acquireTokenSilent(msalGlobal.graphAccessTokenScopes).then(accessToken => {\r\n        }, (error) => {\r\n          console.log(error)\r\n        })\r\n      }, (error) => {\r\n        userAgentApplication.loginRedirect(msalGlobal.graphAccessTokenScopes)\r\n        console.log(error)\r\n      })\r\n  }\r\n}\r\n\r\ncallGraphApi()\r\n```\r\n\r\nRecently I have noticed that MSAL is leaving a bunch of data laying around in local storage. Over time this data continues to grow.\r\n\r\nHere are a couple of screenshots:\r\n\r\n![image](https://user-images.githubusercontent.com/495886/43593772-a2204888-9646-11e8-9e06-0b57ca22f684.png)\r\n\r\n![image](https://user-images.githubusercontent.com/495886/43593817-be299dcc-9646-11e8-8eb7-6d30d20bd6eb.png)\r\n"},"comment":{"url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js/issues/comments/410439904","html_url":"https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/370#issuecomment-410439904","issue_url":"https://api.github.com/repos/AzureAD/microsoft-authentication-library-for-js/issues/370","id":410439904,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMDQzOTkwNA==","user":{"login":"freeman-g","id":495886,"node_id":"MDQ6VXNlcjQ5NTg4Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/495886?v=4","gravatar_id":"","url":"https://api.github.com/users/freeman-g","html_url":"https://github.com/freeman-g","followers_url":"https://api.github.com/users/freeman-g/followers","following_url":"https://api.github.com/users/freeman-g/following{/other_user}","gists_url":"https://api.github.com/users/freeman-g/gists{/gist_id}","starred_url":"https://api.github.com/users/freeman-g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/freeman-g/subscriptions","organizations_url":"https://api.github.com/users/freeman-g/orgs","repos_url":"https://api.github.com/users/freeman-g/repos","events_url":"https://api.github.com/users/freeman-g/events{/privacy}","received_events_url":"https://api.github.com/users/freeman-g/received_events","type":"User","site_admin":false},"created_at":"2018-08-04T10:25:29Z","updated_at":"2018-08-04T10:25:29Z","author_association":"NONE","body":"Thanks for the help"}}
{"actor":{"display_login":"freeman-g"}}