Class BrowserClientRequestUrl

  • All Implemented Interfaces:
    Cloneable, Map<String,​Object>

    public class BrowserClientRequestUrl
    extends AuthorizationRequestUrl
    OAuth 2.0 URL builder for an authorization web page to allow the end user to authorize the application to access their protected resources and that returns the access token to a browser client using a scripting language such as JavaScript, as specified in Implicit Grant.

    The default for AuthorizationRequestUrl.getResponseTypes() is "token".

    Sample usage for a web application:

      public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String url = new BrowserClientRequestUrl(
            "https://server.example.com/authorize", "s6BhdRkqt3").setState("xyz")
            .setRedirectUri("https://client.example.com/cb").build();
        response.sendRedirect(url);
      }
     

    Implementation is not thread-safe.

    Since:
    1.7
    Author:
    Yaniv Inbar