Class OAuth20Authorization
- java.lang.Object
-
- org.openstreetmap.josm.data.oauth.OAuth20Authorization
-
- All Implemented Interfaces:
IOAuthAuthorization
public class OAuth20Authorization extends java.lang.Object implements IOAuthAuthorization
Authorize the application- Since:
- 18650
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classOAuth20Authorization.OAuth20AuthorizationHandler
-
Constructor Summary
Constructors Constructor Description OAuth20Authorization()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidauthorize(IOAuthParameters parameters, java.util.function.Consumer<java.util.Optional<IOAuthToken>> consumer, java.lang.Enum<?>... scopes)Perform the authorization danceprivate static java.lang.StringgetPKCES256CodeChallenge(java.lang.String cryptographicallyRandomString)See RFC7636: PKCEprivate static voidshowUrlOpenFailure(java.lang.String url, java.lang.String error)Show a message if a URL fails to open
-
-
-
Constructor Detail
-
OAuth20Authorization
public OAuth20Authorization()
-
-
Method Detail
-
getPKCES256CodeChallenge
private static java.lang.String getPKCES256CodeChallenge(java.lang.String cryptographicallyRandomString)
See RFC7636: PKCE- Parameters:
cryptographicallyRandomString- A cryptographically secure string- Returns:
- The S256 bytes
-
authorize
public void authorize(IOAuthParameters parameters, java.util.function.Consumer<java.util.Optional<IOAuthToken>> consumer, java.lang.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
private static void showUrlOpenFailure(java.lang.String url, java.lang.String error)
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.
-
-