Class OAuth2Authorization

java.lang.Object
com.codename1.backend.security.oauth2.server.authorization.OAuth2Authorization

public final class OAuth2Authorization extends Object
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.
  • Field Details

  • 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:
      attributes - what else is remembered of the grant, as text, numbers, lists and maps
      createdAt - epoch milliseconds
      expiresAt - 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.