{"action":"created","comment":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/comments/62908791","id":62908791,"diff_hunk":"@@ -0,0 +1,359 @@\n+// Copyright (c) Microsoft Corporation.\n+// All rights reserved.\n+//\n+// This code is licensed under the MIT License.\n+//\n+// Permission is hereby granted, free of charge, to any person obtaining a copy\n+// of this software and associated documentation files(the \"Software\"), to deal\n+// in the Software without restriction, including without limitation the rights\n+// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell\n+// copies of the Software, and to permit persons to whom the Software is\n+// furnished to do so, subject to the following conditions :\n+//\n+// The above copyright notice and this permission notice shall be included in\n+// all copies or substantial portions of the Software.\n+//\n+// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+// THE SOFTWARE.\n+package com.microsoft.aad.adal;\n+\n+import java.io.IOException;\n+\n+import com.microsoft.aad.adal.AuthenticationRequest.UserIdentifierType;\n+\n+import android.content.Context;\n+\n+/**\n+ * Internal class handling the detailed acquiretoken silent logic, including cache lookup and also\n+ * interact with web request.\n+ */\n+class AcquireTokenSilentHandler {\n+    private static final String TAG = AcquireTokenSilentHandler.class.getSimpleName();\n+    \n+    private final Context mContext;\n+    private final TokenCacheAccessor mTokenCacheAccessor;\n+    private final AuthenticationRequest mAuthRequest;\n+    \n+    private boolean mAttemptedWithFRT = false;\n+    private TokenCacheItem mMrrtTokenCacheItem;\n+\n+    /**\n+     * TODO: need to remove. {@link HttpUrlConnectionFactory} provides the possibility to \n+     * mock the real connection. Needs to update the class to make different response based on \n+     * post message. \n+     */\n+    private IWebRequestHandler mWebRequestHandler = null;\n+    \n+    /**\n+     * Constructor for {@link AcquireTokenSilentHandler}. \n+     * {@link TokenCacheAccessor} could be null. If null, won't handle with cache. \n+     */\n+    AcquireTokenSilentHandler(final Context context, final AuthenticationRequest authRequest,\n+            final TokenCacheAccessor tokenCacheAccessor) {","path":"src/src/com/microsoft/aad/adal/AcquireTokenSilentHandler.java","position":57,"original_position":57,"commit_id":"b8d59ff09a87b72e2460115485e534c2af579000","original_commit_id":"b8d59ff09a87b72e2460115485e534c2af579000","user":{"login":"addev-ashish","id":12189888,"avatar_url":"https://avatars.githubusercontent.com/u/12189888?v=3","gravatar_id":"","url":"https://api.github.com/users/addev-ashish","html_url":"https://github.com/addev-ashish","followers_url":"https://api.github.com/users/addev-ashish/followers","following_url":"https://api.github.com/users/addev-ashish/following{/other_user}","gists_url":"https://api.github.com/users/addev-ashish/gists{/gist_id}","starred_url":"https://api.github.com/users/addev-ashish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/addev-ashish/subscriptions","organizations_url":"https://api.github.com/users/addev-ashish/orgs","repos_url":"https://api.github.com/users/addev-ashish/repos","events_url":"https://api.github.com/users/addev-ashish/events{/privacy}","received_events_url":"https://api.github.com/users/addev-ashish/received_events","type":"User","site_admin":false},"body":"File an issue, have a new handler AcquireTokenByRefreshTokenHandler, doens't interact with cache. ","created_at":"2016-05-11T19:16:53Z","updated_at":"2016-05-11T19:16:53Z","html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android/pull/611#discussion_r62908791","pull_request_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611","_links":{"self":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/comments/62908791"},"html":{"href":"https://github.com/AzureAD/azure-activedirectory-library-for-android/pull/611#discussion_r62908791"},"pull_request":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611"}}},"pull_request":{"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611","id":68302833,"html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android/pull/611","diff_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android/pull/611.diff","patch_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android/pull/611.patch","issue_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/611","number":611,"state":"open","locked":false,"title":"Adding support for FoCI","user":{"login":"weijjia","id":1166233,"avatar_url":"https://avatars.githubusercontent.com/u/1166233?v=3","gravatar_id":"","url":"https://api.github.com/users/weijjia","html_url":"https://github.com/weijjia","followers_url":"https://api.github.com/users/weijjia/followers","following_url":"https://api.github.com/users/weijjia/following{/other_user}","gists_url":"https://api.github.com/users/weijjia/gists{/gist_id}","starred_url":"https://api.github.com/users/weijjia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weijjia/subscriptions","organizations_url":"https://api.github.com/users/weijjia/orgs","repos_url":"https://api.github.com/users/weijjia/repos","events_url":"https://api.github.com/users/weijjia/events{/privacy}","received_events_url":"https://api.github.com/users/weijjia/received_events","type":"User","site_admin":false},"body":"Add the support for FoCI. \r\n1) FoCI will be stored as an separate entry\r\n2) Family RT is a Multi resource refresh token, mrrt could also be an RT. \r\n3) if MRRT exists, and it's also a FRT, try to look for FRT, if FRT does't exist, fall back to MRRT. \r\n4) If FRT request fails, and if there is an MRRT, retry with MRRT. ","created_at":"2016-04-28T22:48:40Z","updated_at":"2016-05-11T19:16:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"30e9bbada395aeba84e9e35f1f7fccd7b02507a9","assignee":{"login":"RPangrle","id":7004783,"avatar_url":"https://avatars.githubusercontent.com/u/7004783?v=3","gravatar_id":"","url":"https://api.github.com/users/RPangrle","html_url":"https://github.com/RPangrle","followers_url":"https://api.github.com/users/RPangrle/followers","following_url":"https://api.github.com/users/RPangrle/following{/other_user}","gists_url":"https://api.github.com/users/RPangrle/gists{/gist_id}","starred_url":"https://api.github.com/users/RPangrle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RPangrle/subscriptions","organizations_url":"https://api.github.com/users/RPangrle/orgs","repos_url":"https://api.github.com/users/RPangrle/repos","events_url":"https://api.github.com/users/RPangrle/events{/privacy}","received_events_url":"https://api.github.com/users/RPangrle/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611/commits","review_comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611/comments","review_comment_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/611/comments","statuses_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/statuses/b8d59ff09a87b72e2460115485e534c2af579000","head":{"label":"AzureAD:weij/FoCI","ref":"weij/FoCI","sha":"b8d59ff09a87b72e2460115485e534c2af579000","user":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"repo":{"id":14703238,"name":"azure-activedirectory-library-for-android","full_name":"AzureAD/azure-activedirectory-library-for-android","owner":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android","description":"The ADAL SDK for Android gives you the ability to add support for Work Accounts to your application with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two factor authentication support.","fork":false,"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android","forks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/forks","keys_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/teams","hooks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/hooks","issue_events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/events{/number}","events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/events","assignees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/assignees{/user}","branches_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/branches{/branch}","tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/tags","blobs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/statuses/{sha}","languages_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/languages","stargazers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/stargazers","contributors_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/contributors","subscribers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/subscribers","subscription_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/subscription","commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/contents/{+path}","compare_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/merges","archive_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/downloads","issues_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues{/number}","pulls_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls{/number}","milestones_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/milestones{/number}","notifications_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/labels{/name}","releases_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/releases{/id}","deployments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/deployments","created_at":"2013-11-26T00:59:05Z","updated_at":"2016-05-04T04:52:40Z","pushed_at":"2016-05-11T13:08:11Z","git_url":"git://github.com/AzureAD/azure-activedirectory-library-for-android.git","ssh_url":"git@github.com:AzureAD/azure-activedirectory-library-for-android.git","clone_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android.git","svn_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android","homepage":"http://www.windowsazure.com/en-us/services/active-directory/","size":24981,"stargazers_count":64,"watchers_count":64,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":62,"forks":53,"open_issues":62,"watchers":64,"default_branch":"master"}},"base":{"label":"AzureAD:dev","ref":"dev","sha":"a833d373eaa05760ec499ac3e9a48af8e774fd6d","user":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"repo":{"id":14703238,"name":"azure-activedirectory-library-for-android","full_name":"AzureAD/azure-activedirectory-library-for-android","owner":{"login":"AzureAD","id":2966316,"avatar_url":"https://avatars.githubusercontent.com/u/2966316?v=3","gravatar_id":"","url":"https://api.github.com/users/AzureAD","html_url":"https://github.com/AzureAD","followers_url":"https://api.github.com/users/AzureAD/followers","following_url":"https://api.github.com/users/AzureAD/following{/other_user}","gists_url":"https://api.github.com/users/AzureAD/gists{/gist_id}","starred_url":"https://api.github.com/users/AzureAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AzureAD/subscriptions","organizations_url":"https://api.github.com/users/AzureAD/orgs","repos_url":"https://api.github.com/users/AzureAD/repos","events_url":"https://api.github.com/users/AzureAD/events{/privacy}","received_events_url":"https://api.github.com/users/AzureAD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android","description":"The ADAL SDK for Android gives you the ability to add support for Work Accounts to your application with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two factor authentication support.","fork":false,"url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android","forks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/forks","keys_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/teams","hooks_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/hooks","issue_events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/events{/number}","events_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/events","assignees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/assignees{/user}","branches_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/branches{/branch}","tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/tags","blobs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/refs{/sha}","trees_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/statuses/{sha}","languages_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/languages","stargazers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/stargazers","contributors_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/contributors","subscribers_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/subscribers","subscription_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/subscription","commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/commits{/sha}","git_commits_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/git/commits{/sha}","comments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/comments{/number}","issue_comment_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/comments{/number}","contents_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/contents/{+path}","compare_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/merges","archive_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/downloads","issues_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues{/number}","pulls_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls{/number}","milestones_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/milestones{/number}","notifications_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/labels{/name}","releases_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/releases{/id}","deployments_url":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/deployments","created_at":"2013-11-26T00:59:05Z","updated_at":"2016-05-04T04:52:40Z","pushed_at":"2016-05-11T13:08:11Z","git_url":"git://github.com/AzureAD/azure-activedirectory-library-for-android.git","ssh_url":"git@github.com:AzureAD/azure-activedirectory-library-for-android.git","clone_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android.git","svn_url":"https://github.com/AzureAD/azure-activedirectory-library-for-android","homepage":"http://www.windowsazure.com/en-us/services/active-directory/","size":24981,"stargazers_count":64,"watchers_count":64,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":53,"mirror_url":null,"open_issues_count":62,"forks":53,"open_issues":62,"watchers":64,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611"},"html":{"href":"https://github.com/AzureAD/azure-activedirectory-library-for-android/pull/611"},"issue":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/611"},"comments":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/issues/611/comments"},"review_comments":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611/comments"},"review_comment":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/pulls/611/commits"},"statuses":{"href":"https://api.github.com/repos/AzureAD/azure-activedirectory-library-for-android/statuses/b8d59ff09a87b72e2460115485e534c2af579000"}}}}