OAuth2 Server Register Apps

Before a new OAuth2 is requested by a client, the App must be registered in the server.

Register a new App requires the following information:

  App Name: is the name of the Application. Example: MyApp
  RedirectURI: is where the responses will be redirected. Example:
  ClientId: is public information and is the ID of the client.
  ClientSecret: must be kept confidential.

Optionally you can set the following parameters:

  • ExpiresIn: by default is 3600 seconds, so the token will expire in 1 hour, you can set a greater value if you need.
  • RefreshToken: by default refresh tokens are supported, if not, set this parameter to false.

If a new client wants to authenticate using OAuth2, first the App requires to be registered in the server, you can use:

1. RegisterApp

This method requires the App Name and RedirectURI, and will return a ClientId and ClientSecret.

2. Apps.AddApp

This method requires AppName, RedirectURI, ClientId and ClientSecret. Usually you can use this method when a server has some already created Apps and you want to load them before is started.

Both methods do the same, register the Application in the server, but first is most useful when the App is registered the first time and second method when you want to load all registered apps before start the server (because are saved on database for example).

Stay Informed

When you subscribe to the blog, we will send you an e-mail when there are new updates on the site so you wouldn't miss them.

OAuth2 Server Allow none authenticated requests
OAuth2 Server Endpoints

Related Posts