OAuth2 is a secure authorization framework that lets third-party applications obtain tokens to access user data.
To use a standard OAuth2 flow, an application must first register with the target service. After registration, the application receives a client ID and client secret, which are later used for authorization.
In Moera, this process is simplified by registering a name in the Moera naming service. The registered name becomes the application’s client ID, and a carte, signed with the private signing key, serves as the client secret.
After the target node’s owner authorizes the application, the node adds the
application’s name to a list of names with special privileges. The application
doesn’t need an additional token to use these privileges. Instead, the
application authenticates as usual using a carte and sets the adminScope
field in the carte to indicate the privileges it intends to use.
Here is the Moera OAuth2 flow:
clientScope
field containing grant
.https://moera.page/@/~/grant
with
the following query parameters:
client_id=
the application’s registered name;client_secret=
the carte generated in step 2;scope=
a comma- or space-separated list of privileges
the application is requesting;redirect_uri=
the URL to redirect to after successful authorization
(see step 6).redirect_uri
. If no URL is provided, the client informs the user
that the process is complete and that the page can be closed.