Comments (4)
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.
Maybe challenge_verifier_pair()
.
from datasette-indieauth.
In [1]: from datasette_indieauth import utils
In [2]: utils.challenge_verifier_pair()
Out[2]:
('QeFH7Re2_jAJfCVpB4WtEo3alBB7LuW19EXQatMX5Gg=',
'a6e024deddd984fd7a43c445fa2e1b875f7306f1d9d3e3d0024c9d26ff84e3f5')
from datasette-indieauth.
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)
- verify_profile_url()
- verify_client_identifier() HOT 1
- canonicalize_url()
- async def discover_endpoints(url) HOT 6
- Redeem authorization code
- Neater looking display property
- PKCE verification failing HOT 3
- Remove IndieAuth.com fallback HOT 3
- Live demo HOT 2
- Profile extension causes a 500 error HOT 1
- Smarter error handling for indieauth/done
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) HOT 2
- Hit 100% code coverage HOT 3
- Handle invalid URLs better
- Support username@host identifiers HOT 2
- More robust verification of the "me" value HOT 1
- Correctly handle redirects when seeking authorization_endpoint HOT 2
- ImportError: cannot import name 'escape' from 'jinja2' HOT 1
- Testing errors due to changes to httpx default redirects
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from datasette-indieauth.