{"action":"created","comment":{"url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/comments/77972781","id":77972781,"diff_hunk":"@@ -0,0 +1,225 @@\n+/*\n+ *  Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n+ *\n+ *  WSO2 Inc. licenses this file to you under the Apache License,\n+ *  Version 2.0 (the \"License\"); you may not use this file except\n+ *  in compliance with the License.\n+ *  You may obtain a copy of the License at\n+ *\n+ *  http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ *  Unless required by applicable law or agreed to in writing,\n+ *  software distributed under the License is distributed on an\n+ *  \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ *  KIND, either express or implied.  See the License for the\n+ *  specific language governing permissions and limitations\n+ *  under the License.\n+ */\n+package org.wso2.carbon.extension.identity.authenticator;\n+import com.rsa.authagent.authapi.AuthAgentException;\n+import com.rsa.authagent.authapi.AuthSession;\n+import com.rsa.authagent.authapi.AuthSessionFactory;\n+import org.apache.commons.lang.StringUtils;\n+import org.apache.commons.logging.Log;\n+import org.apache.commons.logging.LogFactory;\n+import org.wso2.carbon.identity.application.authentication.framework.AbstractApplicationAuthenticator;\n+import org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator;\n+import org.wso2.carbon.identity.application.authentication.framework.config.ConfigurationFacade;\n+import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig;\n+import org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext;\n+import org.wso2.carbon.identity.application.authentication.framework.exception.AuthenticationFailedException;\n+import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;\n+import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkConstants;\n+import org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils;\n+import org.wso2.carbon.identity.core.util.IdentityTenantUtil;\n+import org.wso2.carbon.user.api.UserRealm;\n+import org.wso2.carbon.user.api.UserStoreException;\n+import org.wso2.carbon.user.core.service.RealmService;\n+import org.wso2.carbon.utils.CarbonUtils;\n+import javax.servlet.http.HttpServletRequest;\n+import javax.servlet.http.HttpServletResponse;\n+import java.io.File;\n+import java.io.IOException;\n+/**\n+ * RSA SecurId 2-Factor Authenticator\n+ */\n+public class RSASecurIdAuthenticator extends AbstractApplicationAuthenticator\n+        implements LocalApplicationAuthenticator {\n+    private static Log log = LogFactory.getLog(RSASecurIdAuthenticator.class);\n+    /**\n+     * Get the friendly name of the RSA SecurID Authenticator\n+     *\n+     * @return RSA SecurId Authenticator Friendly Name\n+     */\n+    @Override\n+    public String getFriendlyName() {\n+        return RSASecurIdAuthenticatorConstants.AUTHENTICATOR_FRIENDLY_NAME;\n+    }\n+    /**\n+     * Check authentication request can be handled or not.\n+     *\n+     * @param request http servlet request to the authenticator\n+     * @return TRUE if RSA_USER_PASSCODE exists otherwise FALSE\n+     */\n+    @Override\n+    public boolean canHandle(HttpServletRequest request) {\n+        if (log.isDebugEnabled()) {\n+            log.debug(\"Inside RSA SecurId Authenticator canHandle()\");\n+        }\n+        String pin = request.getParameter(RSASecurIdAuthenticatorConstants.RSA_USER_PIN);\n+        String token = request.getParameter(RSASecurIdAuthenticatorConstants.RSA_USER_TOKEN);\n+        if (StringUtils.isNotEmpty(pin) && StringUtils.isNotEmpty(token)) {","path":"component/authenticator/src/main/java/org/wso2/carbon/extension/identity/authenticator/RSASecurIdAuthenticator.java","position":null,"original_position":71,"commit_id":"4bc6d63fd20d87b1f53b8f010a402b5eac6f8429","original_commit_id":"2731e7d160d789a5d45d67a70db472079933ed5a","user":{"login":"nifrasismail","id":6188636,"avatar_url":"https://avatars.githubusercontent.com/u/6188636?v=3","gravatar_id":"","url":"https://api.github.com/users/nifrasismail","html_url":"https://github.com/nifrasismail","followers_url":"https://api.github.com/users/nifrasismail/followers","following_url":"https://api.github.com/users/nifrasismail/following{/other_user}","gists_url":"https://api.github.com/users/nifrasismail/gists{/gist_id}","starred_url":"https://api.github.com/users/nifrasismail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nifrasismail/subscriptions","organizations_url":"https://api.github.com/users/nifrasismail/orgs","repos_url":"https://api.github.com/users/nifrasismail/repos","events_url":"https://api.github.com/users/nifrasismail/events{/privacy}","received_events_url":"https://api.github.com/users/nifrasismail/received_events","type":"User","site_admin":false},"body":"changed. fixed","created_at":"2016-09-08T09:23:51Z","updated_at":"2016-09-08T09:23:52Z","html_url":"https://github.com/wso2-extensions/identity-outbound-auth-rsa/pull/1#discussion_r77972781","pull_request_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/comments/77972781"},"html":{"href":"https://github.com/wso2-extensions/identity-outbound-auth-rsa/pull/1#discussion_r77972781"},"pull_request":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1","id":82839669,"html_url":"https://github.com/wso2-extensions/identity-outbound-auth-rsa/pull/1","diff_url":"https://github.com/wso2-extensions/identity-outbound-auth-rsa/pull/1.diff","patch_url":"https://github.com/wso2-extensions/identity-outbound-auth-rsa/pull/1.patch","issue_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/issues/1","number":1,"state":"open","locked":false,"title":"RSA Authenticatior Added","user":{"login":"nifrasismail","id":6188636,"avatar_url":"https://avatars.githubusercontent.com/u/6188636?v=3","gravatar_id":"","url":"https://api.github.com/users/nifrasismail","html_url":"https://github.com/nifrasismail","followers_url":"https://api.github.com/users/nifrasismail/followers","following_url":"https://api.github.com/users/nifrasismail/following{/other_user}","gists_url":"https://api.github.com/users/nifrasismail/gists{/gist_id}","starred_url":"https://api.github.com/users/nifrasismail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nifrasismail/subscriptions","organizations_url":"https://api.github.com/users/nifrasismail/orgs","repos_url":"https://api.github.com/users/nifrasismail/repos","events_url":"https://api.github.com/users/nifrasismail/events{/privacy}","received_events_url":"https://api.github.com/users/nifrasismail/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-08-26T06:49:10Z","updated_at":"2016-09-08T09:23:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e1946624ff47e0e0ccd378bc7abcae42a7fb9430","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1/commits","review_comments_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1/comments","review_comment_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/issues/1/comments","statuses_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/statuses/4bc6d63fd20d87b1f53b8f010a402b5eac6f8429","head":{"label":"nifrasismail:master","ref":"master","sha":"4bc6d63fd20d87b1f53b8f010a402b5eac6f8429","user":{"login":"nifrasismail","id":6188636,"avatar_url":"https://avatars.githubusercontent.com/u/6188636?v=3","gravatar_id":"","url":"https://api.github.com/users/nifrasismail","html_url":"https://github.com/nifrasismail","followers_url":"https://api.github.com/users/nifrasismail/followers","following_url":"https://api.github.com/users/nifrasismail/following{/other_user}","gists_url":"https://api.github.com/users/nifrasismail/gists{/gist_id}","starred_url":"https://api.github.com/users/nifrasismail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nifrasismail/subscriptions","organizations_url":"https://api.github.com/users/nifrasismail/orgs","repos_url":"https://api.github.com/users/nifrasismail/repos","events_url":"https://api.github.com/users/nifrasismail/events{/privacy}","received_events_url":"https://api.github.com/users/nifrasismail/received_events","type":"User","site_admin":false},"repo":{"id":66528418,"name":"identity-outbound-auth-rsa","full_name":"nifrasismail/identity-outbound-auth-rsa","owner":{"login":"nifrasismail","id":6188636,"avatar_url":"https://avatars.githubusercontent.com/u/6188636?v=3","gravatar_id":"","url":"https://api.github.com/users/nifrasismail","html_url":"https://github.com/nifrasismail","followers_url":"https://api.github.com/users/nifrasismail/followers","following_url":"https://api.github.com/users/nifrasismail/following{/other_user}","gists_url":"https://api.github.com/users/nifrasismail/gists{/gist_id}","starred_url":"https://api.github.com/users/nifrasismail/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nifrasismail/subscriptions","organizations_url":"https://api.github.com/users/nifrasismail/orgs","repos_url":"https://api.github.com/users/nifrasismail/repos","events_url":"https://api.github.com/users/nifrasismail/events{/privacy}","received_events_url":"https://api.github.com/users/nifrasismail/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nifrasismail/identity-outbound-auth-rsa","description":null,"fork":true,"url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa","forks_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/forks","keys_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/teams","hooks_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/hooks","issue_events_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/issues/events{/number}","events_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/events","assignees_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/assignees{/user}","branches_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/branches{/branch}","tags_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/tags","blobs_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/git/refs{/sha}","trees_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/statuses/{sha}","languages_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/languages","stargazers_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/stargazers","contributors_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/contributors","subscribers_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/subscribers","subscription_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/subscription","commits_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/commits{/sha}","git_commits_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/git/commits{/sha}","comments_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/comments{/number}","issue_comment_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/issues/comments{/number}","contents_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/contents/{+path}","compare_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/merges","archive_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/downloads","issues_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/issues{/number}","pulls_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/pulls{/number}","milestones_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/milestones{/number}","notifications_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/labels{/name}","releases_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/releases{/id}","deployments_url":"https://api.github.com/repos/nifrasismail/identity-outbound-auth-rsa/deployments","created_at":"2016-08-25T05:42:37Z","updated_at":"2016-08-25T08:08:42Z","pushed_at":"2016-09-08T09:19:56Z","git_url":"git://github.com/nifrasismail/identity-outbound-auth-rsa.git","ssh_url":"git@github.com:nifrasismail/identity-outbound-auth-rsa.git","clone_url":"https://github.com/nifrasismail/identity-outbound-auth-rsa.git","svn_url":"https://github.com/nifrasismail/identity-outbound-auth-rsa","homepage":null,"size":406,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2-extensions:master","ref":"master","sha":"00d372f6945380230cffb28a2a3a35c01b411c29","user":{"login":"wso2-extensions","id":17171218,"avatar_url":"https://avatars.githubusercontent.com/u/17171218?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2-extensions","html_url":"https://github.com/wso2-extensions","followers_url":"https://api.github.com/users/wso2-extensions/followers","following_url":"https://api.github.com/users/wso2-extensions/following{/other_user}","gists_url":"https://api.github.com/users/wso2-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2-extensions/subscriptions","organizations_url":"https://api.github.com/users/wso2-extensions/orgs","repos_url":"https://api.github.com/users/wso2-extensions/repos","events_url":"https://api.github.com/users/wso2-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/wso2-extensions/received_events","type":"Organization","site_admin":false},"repo":{"id":66528294,"name":"identity-outbound-auth-rsa","full_name":"wso2-extensions/identity-outbound-auth-rsa","owner":{"login":"wso2-extensions","id":17171218,"avatar_url":"https://avatars.githubusercontent.com/u/17171218?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2-extensions","html_url":"https://github.com/wso2-extensions","followers_url":"https://api.github.com/users/wso2-extensions/followers","following_url":"https://api.github.com/users/wso2-extensions/following{/other_user}","gists_url":"https://api.github.com/users/wso2-extensions/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2-extensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2-extensions/subscriptions","organizations_url":"https://api.github.com/users/wso2-extensions/orgs","repos_url":"https://api.github.com/users/wso2-extensions/repos","events_url":"https://api.github.com/users/wso2-extensions/events{/privacy}","received_events_url":"https://api.github.com/users/wso2-extensions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2-extensions/identity-outbound-auth-rsa","description":null,"fork":false,"url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa","forks_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/forks","keys_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/teams","hooks_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/hooks","issue_events_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/issues/events{/number}","events_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/events","assignees_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/assignees{/user}","branches_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/branches{/branch}","tags_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/tags","blobs_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/languages","stargazers_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/stargazers","contributors_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/contributors","subscribers_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/subscribers","subscription_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/subscription","commits_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/contents/{+path}","compare_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/merges","archive_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/downloads","issues_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/issues{/number}","pulls_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/labels{/name}","releases_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/releases{/id}","deployments_url":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/deployments","created_at":"2016-08-25T05:40:26Z","updated_at":"2016-08-25T05:40:26Z","pushed_at":"2016-09-08T09:19:58Z","git_url":"git://github.com/wso2-extensions/identity-outbound-auth-rsa.git","ssh_url":"git@github.com:wso2-extensions/identity-outbound-auth-rsa.git","clone_url":"https://github.com/wso2-extensions/identity-outbound-auth-rsa.git","svn_url":"https://github.com/wso2-extensions/identity-outbound-auth-rsa","homepage":null,"size":4,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1"},"html":{"href":"https://github.com/wso2-extensions/identity-outbound-auth-rsa/pull/1"},"issue":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/issues/1"},"comments":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/wso2-extensions/identity-outbound-auth-rsa/statuses/4bc6d63fd20d87b1f53b8f010a402b5eac6f8429"}}}}
{"actor":{"display_login":"nifrasismail"}}