AuthCodeController class Null safety

Controller for issuing OAuth 2.0 authorization codes.

Deprecated, use AuthRedirectController instead.

This controller provides an endpoint for the creating an OAuth 2.0 authorization code. This authorization code can be exchanged for an access token with an AuthController. This is known as the OAuth 2.0 'Authorization Code Grant' flow.

See operation methods getAuthorizationPage and authorize for more details.

Usage:

  router
    .route("/auth/code")
    .link(() => new AuthCodeController(authServer));
Inheritance
Annotations

Constructors

AuthCodeController(AuthServer authServer, {AuthCodeControllerDelegate? delegate})
Creates a new instance of an AuthCodeController. [...]

Properties

acceptedContentTypes List<ContentType>
Types of content this ResourceController will accept. [...]
read / write, inherited
authServer AuthServer
A reference to the AuthServer used to grant authorization codes.
final
clientID String?
The client ID of the authenticating client. [...]
@Bind("client_id"), read / write
delegate AuthCodeControllerDelegate?
Renders an HTML login form.
final
hashCode int
The hash code for this object. [...]
read-only, inherited
logger Logger
An instance of the 'conduit' logger.
read-only, inherited
nextController Controller?
Receives requests that this controller does not respond to. [...]
read-only, inherited
pathVariables Map<String?, String>?
Parameters parsed from the URI of the request, if any exist. [...]
read-only, inherited
policy CORSPolicy?
The CORS policy of this controller.
read / write, inherited
recycledState Null
Returns state information that is reused across instances of this type. [...]
read-only, inherited
request Request?
The request being processed by this ResourceController. [...]
read / write, inherited
responseContentType ContentType
The default content type of responses from this ResourceController. [...]
read / write, inherited
responseType String?
Must be 'code'.
@Bind("response_type"), read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
state String?
A randomly generated value the client can use to verify the origin of the redirect. [...]
@Bind("state"), read / write

Methods

applyCORSHeadersIfNecessary(Request req, Response resp) → void
inherited
authorize({String? username, String? password, String? scope}) Future<Response>
Creates a one-time use authorization code. [...]
didAddToChannel() → void
Lifecycle callback, invoked after added to channel, but before any requests are served. [...]
inherited
didDecodeRequestBody(RequestBody body) → void
Callback to indicate when a request body has been processed. [...]
inherited
documentComponents(APIDocumentContext context) → void
Tells this object to add its components to context. [...]
inherited
documentOperationDescription(APIDocumentContext context, Operation? operation) String?
Returns a documented description for operation. [...]
inherited
documentOperationParameters(APIDocumentContext context, Operation? operation) List<APIParameter?>
Returns a documented list of APIParameter for operation. [...]
override
documentOperationRequestBody(APIDocumentContext context, Operation? operation) APIRequestBody?
Returns a documented request body for operation. [...]
override
documentOperationResponses(APIDocumentContext context, Operation? operation) Map<String, APIResponse>
Returns a map of possible responses for operation. [...]
override
documentOperations(APIDocumentContext context, String route, APIPath path) Map<String, APIOperation>
Tells this object to return all APIOperations it handles. [...]
override
documentOperationSummary(APIDocumentContext context, Operation? operation) String?
Returns a documented summary for operation. [...]
inherited
documentOperationTags(APIDocumentContext context, Operation? operation) List<String>
Returns a list of tags for operation. [...]
inherited
documentPaths(APIDocumentContext context) Map<String, APIPath>
Tells this object to return all APIPaths it handles. [...]
inherited
getAuthorizationPage({String? scope}) Future<Response>
Returns an HTML login form. [...]
handle(Request request) FutureOr<RequestOrResponse>
The primary request handling method of this object. [...]
inherited
handleError(Request request, dynamic caughtValue, StackTrace trace) Future
Sends an HTTP response for a request that yields an exception or error. [...]
inherited
Links a controller to the receiver to form a request channel. [...]
inherited
linkFunction(FutureOr<RequestOrResponse?> handle(Request request)) Linkable?
Links a function controller to the receiver to form a request channel. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
receive(Request req) Future?
Delivers req to this instance to be processed. [...]
inherited
restore(Null state) → void
Provides a instance of this type with the recycledState of this type. [...]
inherited
toString() String
A string representation of this object. [...]
inherited
willDecodeRequestBody(RequestBody body) → void
Callback invoked prior to decoding a request body. [...]
inherited
willProcessRequest(Request req) FutureOr<RequestOrResponse>
Executed prior to handling a request, but after the request has been set. [...]
inherited
willSendResponse(Response response) → void
Executed prior to Response being sent. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited