demo-eleventy-serverless-oauth
demo-eleventy-serverless-oauth copied to clipboard
Proposed Provider: Stack Overflow / Stack Exchange
Documentation
- https://api.stackexchange.com/docs/authentication
- https://api.stackexchange.com/docs/me
Broad steps (to be validated)
- Get the app's OAuth Domain to be used on the app registration at https://stackapps.com
- Register the OAuth app at https://stackapps.com/apps/oauth/register and get the Stack Overflow Oauth client id and client secret.
- Add the
STACKEXCHANGE_OAUTH_CLIENT_ID
andSTACKEXCHANGE_OAUTH_CLIENT_SECRET
to the corresponding site on Netlify. - Update
providers.js
andauth.js
innetlify/functions/Utils
- Add Stack Exchange to a new provider.
Notes:
1. There are two domains to be used:
https://stackoverflow.com
for authentication andhttps://api.stackexchange.com
to get the user data. 2. On Stack Overflow/Stack Exchange OAuth it is required to set a site name, i.e., stackoverflow, meta, webapps, etc. A basic setup might use a hardcoded site name. Ideally, the form should include aselect
so the user can select the source of the site user profile. Another approach might be to show the user data from the Stack Exchange network profile instead but this should be told to the user.
- Add Stack Exchange to a new provider.
Notes:
1. There are two domains to be used:
- Add a Stack Overflow / Stack Exchange login button to the static form.
Update
I forked this repo and made some changes. I'm not ready yet to make a PR, but it works as a proof of concept.