How to do it...

Once you have the AuthCodeApp imported to Android Studio, perform the following steps to add support for dynamic client registration:

  1. As the application has to handle it's own registration, create the sub-package client/registration.
  2. Then, within the registration package, create the following class to represent client credentials (which is clientId and clientSecret). Don't forget to create the respective getters and setters for each attribute:
public class ClientCredentials {    private String clientId;    private String clientSecret;    // getters and setters omitted for brevity}
  1. Now, to store an instance of ClientCredentials in memory, create the class ClientCredentialsStore which will be a singleton instance as presented in the ...

Get OAuth 2.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.