Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class OAuth2Authorization
- Object
- OAuth2Authorization
One grant: a user – or, for the device grant, nobody yet – having let one
client act with some scopes. The authorization code, the refresh tokens and
the device and user codes issued under it are kept beside it by the
OAuth2AuthorizationService, as hashes; removing the grant revokes them
all.Fields
public static final String ACTIVE = "active" | A grant a user has made. |
public static final String PENDING = "pending" | A device grant the user has not answered. |
public static final String DENIED = "denied" | A device grant the user refused. |
Constructors
Methods
Inherited methods
Field details
ACTIVE
public static final String ACTIVE = "active"A grant a user has made.
PENDING
public static final String PENDING = "pending"A device grant the user has not answered.
DENIED
public static final String DENIED = "denied"A device grant the user refused.
Constructor details
OAuth2Authorization
public OAuth2Authorization(String id, String registeredClientId, String principalName, String authorizationGrantType, Collection<String> scopes, String status, Map<String, Object> attributes, long createdAt, long expiresAt)Parameters
idString- Not documented.
registeredClientIdString- Not documented.
principalNameString- Not documented.
authorizationGrantTypeString- Not documented.
scopesCollection<String>- Not documented.
statusString- Not documented.
attributesMap<String, Object>- what else is remembered of the grant, as text, numbers, lists and maps
createdAtlong- epoch milliseconds
expiresAtlong- when nothing issued under the grant can be used any more, in epoch milliseconds
Method details
getId
public String getId()getRegisteredClientId
public String getRegisteredClientId()The
RegisteredClient.getId of the client the grant was made to.getPrincipalName
public String getPrincipalName()Who made the grant; empty for a device grant nobody has answered.
getAuthorizationGrantType
public String getAuthorizationGrantType()getScopes
public Set<String> getScopes()getStatus
public String getStatus()getAttributes
public Map<String, Object> getAttributes()getAttribute
public Object getAttribute(String name)One attribute, or null.
getCreatedAt
public long getCreatedAt()getExpiresAt
public long getExpiresAt()withExpiresAt
public OAuth2Authorization withExpiresAt(long expiresAt)This grant, good until
expiresAt.