|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pfsw.security.oauth.pkce.AbstractPKCEGenerator
public abstract class AbstractPKCEGenerator
A customizable generic implementation of a PKCEGenerator
where subclasses
determine what code challenge method to be used and how to generate that data.
Constructor Summary | |
---|---|
AbstractPKCEGenerator(CodeChallengeMethod codeChallengeMethod)
Creates a new instance for the given code challenge method and a default random string generator and true for createBase64EncodedCodeVerifiers. |
|
AbstractPKCEGenerator(CodeChallengeMethod codeChallengeMethod,
org.pfsw.text.StringGenerator randomStringGenerator)
Creates a new instance with the given arguments. |
Method Summary | |
---|---|
protected abstract java.lang.String |
createCodeChallenge(java.lang.String codeVerifier)
Returns the derived code challenge string for the given code verifier by applying the getCodeChallengeMethod() . |
ProofKeyForCodeExchange |
generate()
Generates a new random ProofKeyForCodeExchange . |
protected java.lang.String |
generateRandomCodeVerifier()
Returns a new random string to be used as code verifier. |
CodeChallengeMethod |
getCodeChallengeMethod()
Returns the code challenge method this generator is using to create the code challenge. |
protected org.pfsw.text.StringGenerator |
getRandomStringGenerator()
Returns the generator for random strings. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractPKCEGenerator(CodeChallengeMethod codeChallengeMethod)
codeChallengeMethod
- The mechanism to be used for deriving the code challenge from the code verifier (must not be null).public AbstractPKCEGenerator(CodeChallengeMethod codeChallengeMethod, org.pfsw.text.StringGenerator randomStringGenerator)
codeChallengeMethod
- The mechanism to be used for deriving the code challenge from the code verifier (must not be null).randomStringGenerator
- A string generator that produces a different string for each invocation (must not be null).
It will be used to generate new code verifier strings.Method Detail |
---|
public ProofKeyForCodeExchange generate()
PKCEGenerator
ProofKeyForCodeExchange
.
The mechanism how the random code verifier gets generated and the
used code challenge method is up to the implementor of this method.
generate
in interface PKCEGenerator
public CodeChallengeMethod getCodeChallengeMethod()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String generateRandomCodeVerifier()
This method provides a default string generation mechanism that can be overridden by subclasses if needed, but usually the better approach for customization is providing a different StringGenerator during instance creation.
protected org.pfsw.text.StringGenerator getRandomStringGenerator()
protected abstract java.lang.String createCodeChallenge(java.lang.String codeVerifier)
getCodeChallengeMethod()
.
codeVerifier
- The newly created random code verifier.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |