Skip to content

API example backend using passport-oauth2 #258

@ddugovic

Description

@ddugovic

I'm trying to add "Login with Lichess" support to my Discord bot, so it can call Discord's API to assign a "linked role".

I've never worked with Express or OAuth2 before, and am having difficulty understanding example https://github.com/lichess-org/api/tree/master/example/oauth-backend . Somehow https://www.passportjs.org/packages/passport-oauth2/ looks easier to follow, however I haven't used Express before...

Since I don't have an HTTPS domain, whatever webserver code I create likely would be throwaway code, but I assume I'm not the only consumer looking to use OAuth2 with Lichess. For example, my Square Off board can't securely log in with 2FA, and DIY digital board creators might appreciate having a simple example to follow, and somehow passport-oauth2 doesn't look intimidating. But again, maybe I don't know what I'm talking about.

Also, https://www.passportjs.org provides login strategies for Facebook, Twitter, Google, etc.; for SEO reasons it might be cool to get a "Login with Lichess" strategy listed there, although it sounds like passport-oauth2 is what I was looking for.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions