{"id":22268086,"url":"https://github.com/curityio/github-authenticator","last_synced_at":"2025-07-28T12:30:52.858Z","repository":{"id":29174788,"uuid":"110140248","full_name":"curityio/github-authenticator","owner":"curityio","description":"Github oauth authenticator that can be used with any Java-based Web API","archived":false,"fork":false,"pushed_at":"2024-11-07T08:38:22.000Z","size":930,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-07T09:34:51.489Z","etag":null,"topics":["authenticator","github","login","oauth2","plugin"],"latest_commit_sha":null,"homepage":"https://curity.io/resources/learn/github-authenticator/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/curityio.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-09T16:36:36.000Z","updated_at":"2024-11-07T08:37:11.000Z","dependencies_parsed_at":"2022-07-24T20:32:24.833Z","dependency_job_id":null,"html_url":"https://github.com/curityio/github-authenticator","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fgithub-authenticator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fgithub-authenticator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fgithub-authenticator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/curityio%2Fgithub-authenticator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/curityio","download_url":"https://codeload.github.com/curityio/github-authenticator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227905532,"owners_count":17837906,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authenticator","github","login","oauth2","plugin"],"created_at":"2024-12-03T11:11:02.348Z","updated_at":"2025-07-28T12:30:52.849Z","avatar_url":"https://github.com/curityio.png","language":"Java","readme":"GitHub Authenticator Plug-in\n============================\n   \n.. image:: https://img.shields.io/badge/quality-production-green\n    :target: https://curity.io/resources/code-examples/status/\n\n.. image:: https://img.shields.io/badge/availability-binary-blue\n    :target: https://curity.io/resources/code-examples/status/\n\n\nThis project provides an opens source GitHub Authenticator plug-in for the Curity Identity Server. This allows an administrator to add functionality to the Curity Identity Server which will then enable end users to login using their GitHub credentials. The app that integrates with the Curity Identity Server may also be configured to receive the GitHub access token, allowing it to manage resources in a GitHub.\n\nSystem Requirements\n~~~~~~~~~~~~~~~~~~~\n\n* Curity Identity Server 7.1.0 and `its system requirements \u003chttps://developer.curity.io/docs/latest/system-admin-guide/system-requirements.html\u003e`_\n\nRequirements for Building from Source\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\n* Maven 3\n* Java SDK 17 or later\n\nCompiling the Plug-in from Source\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe source is very easy to compile. To do so from a shell, issue this command: ``mvn package``.\n\nInstallation\n~~~~~~~~~~~~\n\nTo install this plug-in, either download a binary version available from the `releases section of this project's GitHub repository \u003chttps://github.com/curityio/github-authenticator/releases\u003e`_ or compile it from source (as described above). If you compiled the plug-in from source, the package will be placed in the ``target`` subdirectory. The resulting JAR file or the one downloaded from GitHub needs to placed in the directory ``${IDSVR_HOME}/usr/share/plugins/github``. (The name of the last directory, ``github``, which is the plug-in group, is arbitrary and can be anything.) After doing so, the plug-in will become available as soon as the node is restarted.\n\n.. note::\n\n    The JAR file needs to be deployed to each run-time node and the admin node. For simple test deployments where the admin node is a run-time node, the JAR file only needs to be copied to one location.\n\nFor a more detailed explanation of installing plug-ins, refer to the `Curity developer guide \u003chttps://developer.curity.io/docs/latest/developer-guide/plugins/index.html#plugin-installation\u003e`_.\n\nCreating an App in GitHub\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\nAs `described in the GitHub documentation \u003chttps://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app\u003e`_, You can `create and register \u003chttps://github.com/settings/applications/new\u003e`_ an OAuth App under your personal account or under any organization you have administrative access to.\n\n    .. figure:: docs/images/create-github-app1.png\n            :name: new-github-app\n            :align: center\n            :width: 500px\n\nCreating a new GitHub application\n\n    .. figure:: docs/images/create-github-app2.png\n            :name: create-github-app\n            :align: center\n            :width: 500px\n\nThen, give the app a name, e.g., ``Curity-Enterprise-Integration-App``.\n\nWhen you view the app's configuration after creating it, you'll find the ``Client ID`` and ``Client Secret``. These will be needed later when configuring the plug-in in Curity.\n\nGitHub will also display the Authorization callback URL in the new app's configuration. This needs to match the yet-to-be-created GitHub authenticator instance in Curity. The default will not work, and, if used, will result in an error. This should be updated to some URL that follows the pattern ``$baseUrl/$authenticationEndpointPath/$githubAuthnticatorId/callback``, where each of these URI components has the following meaning:\n\n============================== =========================================================================================\nURI Component                  Meaning\n------------------------------ -----------------------------------------------------------------------------------------\n``baseUrl``                    The base URL of the server (defined on the ``System --\u003e General`` page of the\n                               admin GUI). If this value is not set, then the server scheme, name, and port should be\n                               used (e.g., ``https://localhost:8443``).\n``authenticationEndpointPath`` The path of the authentication endpoint. In the admin GUI, this is located in the\n                               authentication profile's ``Endpoints`` tab for the endpoint that has the type\n                               ``auth-authentication``.\n``githubAuthenticatorId``         This is the name given to the GitHub authenticator when defining it (e.g., ``github1``).\n============================== =========================================================================================\n\nOnce the redirect URI is updated, the app is ready to be used from Curity.\n\nCreating a GitHub Authenticator in Curity\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe easiest way to configure a new GitHub authenticator is using the Curity admin UI. The configuration for this can be downloaded as XML or CLI commands later, so only the steps to do this in the GUI will be described.\n\n1. Go to the ``Authenticators`` page of the authentication profile wherein the authenticator instance should be created.\n2. Click the ``New Authenticator`` button.\n3. Enter a name (e.g., ``github1``). This name needs to match the URI component in the callback URI set in the GitHub app.\n4. For the type, pick the ``GitHub`` option:\n\n.. figure:: docs/images/github-authenticator-type-in-curity.png\n        :align: center\n        :width: 600px\n\n5. On the next page, you can define all of the standard authenticator configuration options like any previous authenticator that should run, the resulting ACR, transformers that should executed, etc. At the bottom of the configuration page, the GitHub-specific options can be found.\n\n.. note::\n\nThe GitHub-specific configuration is generated dynamically based on the `configuration model defined in the Java interface \u003chttps://github.com/curityio/github-authenticator/blob/master/src/main/java/io/curity/identityserver/plugin/github/config/GitHubAuthenticatorPluginConfig.java\u003e`_.\n\n6. Certain required and optional configuration settings may be provided. One of these is the ``HTTP Client`` setting. This is the HTTP client that will be used to communicate with the GitHub OAuth server's token and user info endpoints. To define this, do the following:\n\n    A. click the ``Facilities`` button at the top-right of the screen.\n    B. Next to ``HTTP``, click ``New``.\n    C. Enter some name (e.g., ``githubClient``).\n    D. Click ``Apply``.\n\n        .. figure:: docs/images/github-http-client.png\n                :align: center\n                :width: 400px\n\n7. Back in the GitHub authenticator instance that you started to define, select the new HTTP client from the dropdown.\n\n       .. figure:: docs/images/http-client.png\n\n8. In the ``Client ID`` textfield, enter the client ID from the GitHub app configuration.\n9. Also enter the matching ``Client Secret``.\n10. If you have enabled any scopes or wish to limit the scopes that Curity will request of GitHub, toggle on the desired scopes (e.g., ``Manage Organization`` or ``Gists``).\n\nOnce all of these changes are made, they will be staged, but not committed (i.e., not running). To make them active, click the ``Commit`` menu option in the ``Changes`` menu. Optionally enter a comment in the ``Deploy Changes`` dialogue and click ``OK``.\n\nOnce the configuration is committed and running, the authenticator can be used like any other.\n\nTests\n~~~~~\n\nThe plugin is tested using end to end tests that run on a GitHub Actions workflow. The test starts up an instance of the\nCurity Identity Server, a simple SPA and uses Cypress to perform a login flow.\n\nRunning tests Locally with Cypress\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nTo run the test suite locally, first ensure that you have an instance of the Curity Identity Server running with the plugin\ninstalled and using the configuration found in `tests/idsvr/config.xml`. Next install Cypress using the following commands. ::\n\n    cd tests\n    npm i\n\nYou can then open the Cypress app to run tests with ``npm run cypress.open`` or run the headless version of the tests with\n``npm run cypress.run``.\n\nRunning the GitHub Actions Workflow Locally\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nTo run the GitHub Actions workflow locally refer to this `README \u003chttps://github.com/curityio/github-action-utilities\u003e`.\n\nLicense\n~~~~~~~\n\nThis plugin and its associated documentation is listed under the `Apache 2 license \u003cLICENSE\u003e`_.\n\nMore Information\n~~~~~~~~~~~~~~~~\n\nPlease visit `curity.io \u003chttps://curity.io/\u003e`_ for more information about the Curity Identity Server.\n\nCopyright (C) 2017 Curity AB.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fgithub-authenticator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcurityio%2Fgithub-authenticator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcurityio%2Fgithub-authenticator/lists"}