1. @httpGet
Future<Response> getAuthorizationPage({String scope })

Returns an HTML login form.

A client that wishes to authenticate with this server should direct the user to this page. The user will enter their username and password, and upon successful authentication, the returned page will redirect the user back to the initial application. The redirect URL will contain a 'code' query parameter that the application can intercept and send to the route that exchanges authorization codes for tokens.

The 'client_id' must be a registered, valid client of this server. The client must also provide a state to this request and verify that the redirect contains the same value in its query string.

Source

@httpGet
Future<Response> getAuthorizationPage(
    {@HTTPQuery("scope") String scope}) async {
  if (_renderFunction == null) {
    return new Response(405, {}, null);
  }

  var renderedPage = await _renderFunction(this, request.innerRequest.uri, {
    "response_type": responseType,
    "client_id": clientID,
    "state": state,
    "scope": scope
  });
  if (renderedPage == null) {
    return new Response.notFound();
  }

  return new Response.ok(renderedPage)
    ..contentType = ContentType.HTML;
}