Giter VIP home page Giter VIP logo

Comments (4)

simonw avatar simonw commented on September 26, 2024

The client first creates a code verifier for each authorization request by generating a random string using the characters [A-Z] / [a-z] / [0-9] / - / . / _ / ~ with a minimum length of 43 characters and maximum length of 128 characters.

Then:

The client then creates the code challenge derived from the code verifier by calculating the SHA256 hash of the code verifier and Base64-URL-encoding the result.
code_challenge = BASE64URL-ENCODE(SHA256(ASCII(code_verifier)))

So I need to generate a code_verifier, code_challenge pair

from datasette-indieauth.

simonw avatar simonw commented on September 26, 2024

Maybe challenge_verifier_pair().

from datasette-indieauth.

simonw avatar simonw commented on September 26, 2024
In [1]: from datasette_indieauth import utils
In [2]: utils.challenge_verifier_pair()
Out[2]: 
('QeFH7Re2_jAJfCVpB4WtEo3alBB7LuW19EXQatMX5Gg=',
 'a6e024deddd984fd7a43c445fa2e1b875f7306f1d9d3e3d0024c9d26ff84e3f5')

from datasette-indieauth.

simonw avatar simonw commented on September 26, 2024

Next step: build the URL:

https://example.org/auth?response_type=code&
                          client_id=https://app.example.com/&
                          redirect_uri=https://app.example.com/redirect&
                          state=1234567890&
                          code_challenge=OfYAxt8zU2dAPDWQxTAUIteRzMsoj9QBdMIVEDOErUo&
                          code_challenge_method=S256&
                          scope=profile+create+update+delete&
                          me=https://user.example.net/

from datasette-indieauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.