{"action":"created","issue":{"url":"https://api.github.com/repos/auth0/auth0-angular/issues/101","labels_url":"https://api.github.com/repos/auth0/auth0-angular/issues/101/labels{/name}","comments_url":"https://api.github.com/repos/auth0/auth0-angular/issues/101/comments","events_url":"https://api.github.com/repos/auth0/auth0-angular/issues/101/events","html_url":"https://github.com/auth0/auth0-angular/issues/101","id":46964763,"number":101,"title":"refreshIdToken doesn't use same scope","user":{"login":"ahaid","id":2990017,"avatar_url":"https://avatars.githubusercontent.com/u/2990017?v=3","gravatar_id":"","url":"https://api.github.com/users/ahaid","html_url":"https://github.com/ahaid","followers_url":"https://api.github.com/users/ahaid/followers","following_url":"https://api.github.com/users/ahaid/following{/other_user}","gists_url":"https://api.github.com/users/ahaid/gists{/gist_id}","starred_url":"https://api.github.com/users/ahaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahaid/subscriptions","organizations_url":"https://api.github.com/users/ahaid/orgs","repos_url":"https://api.github.com/users/ahaid/repos","events_url":"https://api.github.com/users/ahaid/events{/privacy}","received_events_url":"https://api.github.com/users/ahaid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-10-27T21:55:48Z","updated_at":"2015-03-21T15:52:05Z","closed_at":null,"body":"When I make a call to my API using a token that has been refreshed, the scopes I requested in the initial signin aren't being kept. This causes the decodedPayload to not have all the profile fields I asked for.\r\n\r\nHere's my signin:\r\n\r\n    $scope.login = function() {\r\n        auth.signin({\r\n            authParams: {\r\n              scope: 'openid profile email offline_access',\r\n              device: 'browser'\r\n            }}, function(profile, token, access_token, state, refresh_token) {\r\n          store.set('profile', profile);\r\n          store.set('idToken', token);\r\n          store.set('refreshToken', refresh_token)\r\n          $location.path(\"/\");\r\n        }, function(error) {\r\n          console.log(\"There was an error logging in\", error);\r\n        });\r\n    }\r\n\r\nUpon calling jwtHelper.decodeToken (client or server-side) with the idToken stored above, the decoded payload will have the entire user profile and email. However, if the original idToken expires and I refresh it, the following calls to my API server only have the minimal ID fields. All profile data and email are gone.\r\n\r\nHere is my refresh code:\r\n\r\n    jwtInterceptorProvider.tokenGetter = function(store, $http, jwtHelper, auth) {\r\n          var idToken = store.get('idToken');\r\n          var refreshToken = store.get('refreshToken');\r\n          if (idToken != null){\r\n              if (jwtHelper.isTokenExpired(idToken)) {\r\n               return auth.refreshIdToken(refreshToken);\r\n              }\r\n          }\r\n          return idToken;\r\n        }\r\n\r\n\r\nHow can I instruct the refreshIdToken call to use the same scopes as the signin call?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/auth0/auth0-angular/issues/comments/84376310","html_url":"https://github.com/auth0/auth0-angular/issues/101#issuecomment-84376310","issue_url":"https://api.github.com/repos/auth0/auth0-angular/issues/101","id":84376310,"user":{"login":"msandt3","id":2781585,"avatar_url":"https://avatars.githubusercontent.com/u/2781585?v=3","gravatar_id":"","url":"https://api.github.com/users/msandt3","html_url":"https://github.com/msandt3","followers_url":"https://api.github.com/users/msandt3/followers","following_url":"https://api.github.com/users/msandt3/following{/other_user}","gists_url":"https://api.github.com/users/msandt3/gists{/gist_id}","starred_url":"https://api.github.com/users/msandt3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msandt3/subscriptions","organizations_url":"https://api.github.com/users/msandt3/orgs","repos_url":"https://api.github.com/users/msandt3/repos","events_url":"https://api.github.com/users/msandt3/events{/privacy}","received_events_url":"https://api.github.com/users/msandt3/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T15:52:05Z","updated_at":"2015-03-21T15:52:05Z","body":"Hey @mgonto I'll create a github project you can clone today. It's from a largely proprietary codebase so I'm going to abstract a lot of the business logic before I share. Stay tuned. "}}