Authorize Dialog
Parameters
Authorization URL
In order to obtain an OAuth2 authorization code you should first send the user to the Restream OAuth2 Login page.
Send the user to the following URL with the specified parameters:
User flow
This endpoint will render a view and automatically attempt to authenticate the user if they already have a valid session from Restream.io.
If successful, the user will automatically be presented with the authorization dialog.
Otherwise, they will be presented with a form where the user can login or create a new account. Upon successful login or registration, the user will be presented with the authorization dialog.
If the user denies the dialog, they will be redirected back to the redirect_uri with no parameters.
Info: While it is not implemented yet, in the future if a user only selects a subset of permissions your application has asked for, you must allow the user to continue without enforcing permissions unless it were to affect the functionality of your client app. A scope parameter will be returned in the Capture step.
Security
The state token is used to prevent CSRF attacks and should be generated and saved using web storage when the client presents the user to authenticate with Restream. In the Capture step, the state parameter will be sent back as a query parameter. This value should equal the initial value sent in the original request. If it is not equal, do not issue a request for exchanging the code for a token.