Class OAuth20Authorization
java.lang.Object
org.openstreetmap.josm.data.oauth.OAuth20Authorization
- All Implemented Interfaces:
IOAuthAuthorization
Authorize the application
- Since:
- 18650
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthorize(IOAuthParameters parameters, Consumer<Optional<IOAuthToken>> consumer, Enum<?>... scopes) Perform the authorization danceprivate static StringgetPKCES256CodeChallenge(String cryptographicallyRandomString) See RFC7636: PKCEprivate static voidshowUrlOpenFailure(String url, String error) Show a message if a URL fails to open
-
Constructor Details
-
OAuth20Authorization
public OAuth20Authorization()
-
-
Method Details
-
getPKCES256CodeChallenge
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:IOAuthAuthorizationPerform the authorization dance- Specified by:
authorizein interfaceIOAuthAuthorization- Parameters:
parameters- The OAuth parametersconsumer- The callback for the generated tokenscopes- The scopes to ask for
-
showUrlOpenFailure
Show a message if a URL fails to open- Parameters:
url- The URL that failed to openerror- The message indicating why the URL failed to open; ifnull, no message is shown.
-