You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can extend OAuth2 core parameters as OAuth2 core spec Chapter 8 says without modification to OAuth2 core package.
Here is how to:
create new class which extends BaseTokenType class of core package.
define new TokenType as class variables.
create static block which call addExtension method of BaseTokenType class
with thid new class's instance as parameter.
define protected constructor and some other method you want.
done!! Below is the sample:
public class SampleExtendedTokenType extends BaseTokenType {
public static final String MAC = "mac";
static {
addExtension(new SampleExtendedTokenType());
}
protected SampleExtendedTokenType() {
}
}
You can use this extension like this:
SampleExtendedTokenType tokenType = (SampleExtendedTokenType) BaseTokenType.getInstance();
System.out.println(tokenType.MAC); // this is extended fields
System.out.printlns(tokenType.BEARER); // this is original fields
Example here is about TokenType extendable parameter class.
But there are other extendable parameters class such as: