Search code examples
authenticationgithubsingle-sign-onplunker

How does the Plunker authentication work


All. Forgive me if my question is off topic or a dumb question. I really want to know how to implement a authentication mechanist like GitHub for Plunker. In my project.I think I have the same situation like this. I have some websites like Plunker. and I want to implement a SSO center authication website or services for all the other websites like GitHub. when I click the button Sign in with GitHub in the Plunker. The website will open the new windows with the url https://github.com/login?return_to=%2Flogin%2Foauth%2Fauthorize%3Fclient_id%3D7e377e5657c4d5c332db%26redirect_uri%3Dhttp%253A%252F%252Fplnkr.co%252Fauth%252Fgithub%26scope%3Dgist

When I succeed to login in GitHub. Then the Plunker will login with the authenticated user I just used in the GitHub.

My problem is I don't know how does the authentication works between the GitHub and Plunker. Could someone please tell me something about it ? It will be appriciated. Thanks.


Solution

  • Plunker's "log in with GitHub" button uses OAuth2, an open standard for this kind of thing. It's the same technology used by Google for their sign-in with Google functionality, as well as many other providers.

    Here is GitHub's documentation for adding "log in with OAuth" to your site.

    Creating your own OAuth provider is a significant task, and one that you probably don't want to tackle without weighing carefully. If you do choose to go down this path you'll likely want to use an existing library for your language or stack of choice, e.g. perhaps something from this list. This is also good advice if you only plan to build an OAuth client.