public class CodeService
extends java.lang.Object
Constructor and Description |
---|
CodeService(java.util.function.Supplier<WhitelistStore> whitelistStore,
java.util.function.Supplier<com.perforce.p4java.server.IOptionsServer> optionsServerSupplier,
java.util.function.Supplier<AuthorizationCodeStore> authorizationCodeStoreSupplier) |
Modifier and Type | Method and Description |
---|---|
CodeResult |
authenticateCodeRequest(java.lang.String login,
java.lang.String password,
java.lang.String redirectUrl)
Handles local log-in from the user.
|
AccessTokenResult |
createAccessToken(java.lang.String login,
java.lang.String redirectUri,
java.lang.String code) |
CodeError |
startCodeRequest(java.lang.String redirectUrl)
Generates an authorization code for the user, appropriate for the
redirectUrl.
|
public CodeService(java.util.function.Supplier<WhitelistStore> whitelistStore, java.util.function.Supplier<com.perforce.p4java.server.IOptionsServer> optionsServerSupplier, java.util.function.Supplier<AuthorizationCodeStore> authorizationCodeStoreSupplier)
public CodeError startCodeRequest(java.lang.String redirectUrl) throws java.io.IOException
The server MUST have the redirectUrl in it's whitelist. When we run this method, we simply make sure that the redirect URL is valid, and then generate a new "request code" that we use in a redirect to our local login screen.
redirectUrl
- java.io.IOException
public CodeResult authenticateCodeRequest(java.lang.String login, java.lang.String password, java.lang.String redirectUrl) throws java.io.IOException
login
- Perforce loginpassword
- Perforce passwordredirectUrl
- The URI we'll redirect back to, required to be
whitelistedjava.io.IOException
public AccessTokenResult createAccessToken(java.lang.String login, java.lang.String redirectUri, java.lang.String code) throws java.io.IOException
java.io.IOException