GitHub PullRequestReviewCommentEvent at 2014-03-28 22:25:28
Repository: azure-activedirectory-library-for-android
Actor: brentschmaltz
Payload: {"comment":{"url":"https://api.github.com/repos/MSOpenTech/azure-activedirectory-library-for-android/pulls/comments/11088398","id":11088398,"diff_hunk":"@@ -178,38 +292,92 @@ public boolean onTouch(View view, MotionEvent event) {\n         mWebView.getSettings().setBuiltInZoomControls(true);\n         mWebView.setWebViewClient(new CustomWebViewClient());\n         mWebView.setVisibility(View.INVISIBLE);\n-        Logger.v(TAG, \"User agent:\" + mWebView.getSettings().getUserAgentString());\n-        mStartUrl = \"about:blank\";\n+    }\n \n-        try {\n-            mStartUrl = new Oauth2(mAuthRequest, null).getCodeRequestUrl();\n-        } catch (UnsupportedEncodingException e) {\n-            e.printStackTrace();\n-            Log.d(TAG, e.getMessage());\n+    private AuthenticationRequest getAuthenticationRequestFromIntent(Intent callingIntent) {\n+        AuthenticationRequest authRequest = null;\n+        if (insideBroker()) {\n+            String authority = callingIntent\n+                    .getStringExtra(AuthenticationConstants.Broker.ACCOUNT_AUTHORITY);\n+            String resource = callingIntent\n+                    .getStringExtra(AuthenticationConstants.Broker.ACCOUNT_RESOURCE);\n+            String redirect = callingIntent\n+                    .getStringExtra(AuthenticationConstants.Broker.ACCOUNT_REDIRECT);\n+            String loginhint = callingIntent\n+                    .getStringExtra(AuthenticationConstants.Broker.ACCOUNT_LOGIN_HINT);\n+            String accountName = callingIntent\n+                    .getStringExtra(AuthenticationConstants.Broker.ACCOUNT_NAME);\n+            String clientid = callingIntent\n+                    .getStringExtra(AuthenticationConstants.Broker.ACCOUNT_CLIENTID_KEY);\n+            String correlationId = callingIntent\n+                    .getStringExtra(AuthenticationConstants.Broker.ACCOUNT_CORRELATIONID);\n+            mWaitingRequestId = callingIntent.getIntExtra(\n+                    AuthenticationConstants.Browser.REQUEST_ID, 0);\n+            UUID correlationIdParsed = null;\n+            if (!StringExtensions.IsNullOrBlank(correlationId)) {\n+                try {\n+                    correlationIdParsed = UUID.fromString(correlationId);\n+                } catch (IllegalArgumentException ex) {\n+                    correlationIdParsed = null;\n+                    Logger.e(TAG, \"CorrelationId is malformed: \" + correlationId, \"\",\n+                            ADALError.CORRELATION_ID_FORMAT);\n+                }\n+            }\n+            authRequest = new AuthenticationRequest(authority, resource, clientid, redirect,\n+                    loginhint, correlationIdParsed);\n+            authRequest.setBrokerAccountName(accountName);\n+        } else {\n+            Serializable request = callingIntent\n+                    .getSerializableExtra(AuthenticationConstants.Browser.REQUEST_MESSAGE);\n \n-            Intent resultIntent = new Intent();\n+            if (request instanceof AuthenticationRequest) {\n+                authRequest = (AuthenticationRequest)request;\n+            }\n+        }\n+        return authRequest;\n+    }\n+\n+    /**\n+     * Return error to caller and finish this activity\n+     */\n+    private void returnError(ADALError errorCode, String argument) {\n+","path":"adal/src/com/microsoft/adal/AuthenticationActivity.java","position":248,"original_position":248,"commit_id":"bf510c23c2cecd62342f7f60d3b6641af314d300","original_commit_id":"bf510c23c2cecd62342f7f60d3b6641af314d300","user":{"login":"brentschmaltz","id":3172421,"avatar_url":"https://avatars.githubusercontent.com/u/3172421?","gravatar_id":"ab99ee9cf4bfd7ebc1957f08b4125b6e","url":"https://api.github.com/users/brentschmaltz","html_url":"https://github.com/brentschmaltz","followers_url":"https://api.github.com/users/brentschmaltz/followers","following_url":"https://api.github.com/users/brentschmaltz/following{/other_user}","gists_url":"https://api.github.com/users/brentschmaltz/gists{/gist_id}","starred_url":"https://api.github.com/users/brentschmaltz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brentschmaltz/subscriptions","organizations_url":"https://api.github.com/users/brentschmaltz/orgs","repos_url":"https://api.github.com/users/brentschmaltz/repos","events_url":"https://api.github.com/users/brentschmaltz/events{/privacy}","received_events_url":"https://api.github.com/users/brentschmaltz/received_events","type":"User","site_admin":false},"body":"remove empty line","created_at":"2014-03-28T22:25:28Z","updated_at":"2014-03-28T22:25:28Z","html_url":"https://github.com/MSOpenTech/azure-activedirectory-library-for-android/pull/103#discussion_r11088398","pull_request_url":"https://api.github.com/repos/MSOpenTech/azure-activedirectory-library-for-android/pulls/103","_links":{"self":{"href":"https://api.github.com/repos/MSOpenTech/azure-activedirectory-library-for-android/pulls/comments/11088398"},"html":{"href":"https://github.com/MSOpenTech/azure-activedirectory-library-for-android/pull/103#discussion_r11088398"},"pull_request":{"href":"https://api.github.com/repos/MSOpenTech/azure-activedirectory-library-for-android/pulls/103"}}}}