Class OAuth20Authorization

java.lang.Object
org.openstreetmap.josm.data.oauth.OAuth20Authorization
All Implemented Interfaces:
IOAuthAuthorization

public class OAuth20Authorization extends Object implements IOAuthAuthorization
Authorize the application
Since:
18650
  • Constructor Details

  • Method Details

    • getPKCES256CodeChallenge

      private static String getPKCES256CodeChallenge(String cryptographicallyRandomString)
      See RFC7636: PKCE
      Parameters:
      cryptographicallyRandomString - A cryptographically secure string
      Returns:
      The S256 bytes
    • authorize

      public void authorize(IOAuthParameters parameters, Consumer<Optional<IOAuthToken>> consumer, Enum<?>... scopes)
      Description copied from interface: IOAuthAuthorization
      Perform the authorization dance
      Specified by:
      authorize in interface IOAuthAuthorization
      Parameters:
      parameters - The OAuth parameters
      consumer - The callback for the generated token
      scopes - The scopes to ask for
    • showUrlOpenFailure

      private static void showUrlOpenFailure(String url, String error)
      Show a message if a URL fails to open
      Parameters:
      url - The URL that failed to open
      error - The message indicating why the URL failed to open; if null, no message is shown.