GlitchOAuth: use glitch as a login method for your website/service

glitchoauth

hint: it’s not really oauth


Demo video: Demo: Using Glitch as an login provider - YouTube

Glitch didn’t make it, so I did.

How to login to a website using this

  1. Enter your username, then click “Generate token”
  2. Paste that token into your Glitch profile
  3. Click “Login”, and a new box will appear. This is your login token. Paste it into the website that sent you here.

How to integrate it with your site

It’s very simple. Just have them come to this site (to make it easier for the user, append ?username=USERNAME to the url, and ?redirect=URL to the end of the URL (will redirect as a GET request with a ?token=TOKEN to the redirect param)

Once finished, take the token they provided and send it to /check?token=TOKEN. If a invalid token appears, null will be sent back. Otherwise, it might look something like this

{
   "aboutDavid":{
      "isSupport":false,
      "isInfrastructureUser":false,
      "id":8045597,
      "avatarUrl":"https://s3.amazonaws.com/production-assetsbucket-8ljvyr1xczmb/user-avatar/1d263e89-a03b-4651-ba0f-e2d212c76da8-large.jpg",
      "avatarThumbnailUrl":"https://s3.amazonaws.com/production-assetsbucket-8ljvyr1xczmb/user-avatar/1d263e89-a03b-4651-ba0f-e2d212c76da8-small.jpg",
      "login":"aboutDavid",
      "name":"David",
      "location":null,
      "color":"#f9a47a",
      "description":"hi!\n\naboutdavid.me\n\nlogin: a5b8b91f13c77e9d1858571b418c1ea6e7492752",
      "hasCoverImage":false,
      "coverColor":null,
      "thanksCount":13,
      "utcOffset":-300,
      "featuredProjectId":null,
      "createdAt":"2019-10-26T01:48:36.394Z",
      "updatedAt":"2021-08-22T03:26:35.833Z",
      "features":[
         {
            "id":9927,
            "name":"custom_domains",
            "data":null,
            "expiresAt":"2120-02-19T20:25:00.808Z"
         }
      ]
   }
}

Note: Codes expire after one use because of security reasons

Project | Example


hi! i’m david. I like using node.js, ejs, nunjucks, and php to make websites. I live in the USA :us:

7 Likes

cool idea

maybe you could add some redirect hijinks like the usual oauth to reduce the copy+paste steps in the login flow

1 Like

Good idea. Implemented.

1 Like