Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class TokenEndpoint

  1. Object
  2. TokenEndpoint

A token endpoint: where a grant posts its form, and how the answer is read.

The transport is replaceable so a grant can be exercised without a socket – the tests and the native self-check post to an in-process fake and assert on the exact form that was sent.

Nested types

interface TokenEndpoint.TransportSends one form-encoded POST.
class TokenEndpoint.ResponseA token endpoint’s answer.

Fields

public static final long DEFAULT_LIFETIME_SECONDS = 300LLifetime assumed for a token whose response gives no expires_in.
public static final TokenEndpoint.Transport WEBThe transport every grant uses unless it is given another: Web.

Constructors

public TokenEndpoint(String uri, TokenEndpoint.Transport transport, Clock clock)

Methods

public String getUri()

Inherited methods

Field details

DEFAULT_LIFETIME_SECONDS

public static final long DEFAULT_LIFETIME_SECONDS = 300L
Lifetime assumed for a token whose response gives no expires_in. RFC 6749 leaves the default to the server; assuming a short one costs an extra exchange now and then, assuming a long one presents a dead token.

WEB

public static final TokenEndpoint.Transport WEB
The transport every grant uses unless it is given another: Web.

Constructor details

TokenEndpoint

public TokenEndpoint(String uri, TokenEndpoint.Transport transport, Clock clock)

Method details

getUri

public String getUri()