flwr_oauth2/client_registration

Types

pub type ClientInformationResponse {
  ClientInformationResponse(
    client_id: String,
    client_id_issued_at: option.Option(timestamp.Timestamp),
    client_metadata: ClientMetadata,
  )
  ConfidentialClientInformationResponse(
    client_id: String,
    client_id_issued_at: option.Option(timestamp.Timestamp),
    client_metadata: ClientMetadata,
    client_secret: common.Secret,
  )
}

Constructors

pub type ClientMetadata {
  ClientMetadata(
    redirect_uris: List(uri.Uri),
    software_statement: option.Option(String),
    token_endpoint_auth_method: option.Option(
      TokenEndpointAuthMethod,
    ),
    grant_types: List(GrantType),
    response_types: List(ResponseType),
    client_name: option.Option(String),
    client_name_localized: dict.Dict(String, String),
    client_uri: option.Option(uri.Uri),
    client_uri_localized: dict.Dict(String, uri.Uri),
    logo_uri: option.Option(uri.Uri),
    logo_uri_localized: dict.Dict(String, uri.Uri),
    scope: List(String),
    contacts: List(String),
    tos_uri: option.Option(uri.Uri),
    tos_uri_localized: dict.Dict(String, uri.Uri),
    policy_uri: option.Option(uri.Uri),
    policy_uri_localized: dict.Dict(String, uri.Uri),
    jwks: JwksLocation,
    software_id: option.Option(String),
    software_version: option.Option(String),
  )
}

Constructors

pub type ClientRegistrationRequest {
  ClientRegistrationRequest(
    client_creation_endpoint: uri.Uri,
    access_token: option.Option(String),
    client_metadata: ClientMetadata,
  )
}

Constructors

pub type GrantType {
  AuthorizationCode
  Implicit
  Password
  ClientCredentials
  RefreshToken
  UrnIetfParamsOauthGrantTypeJwtBearer
  UrnIetfParamsOauthGrantTypeSaml2Bearer
  OtherGrantType(name: String)
}

Constructors

  • AuthorizationCode
  • Implicit
  • Password
  • ClientCredentials
  • RefreshToken
  • UrnIetfParamsOauthGrantTypeJwtBearer
  • UrnIetfParamsOauthGrantTypeSaml2Bearer
  • OtherGrantType(name: String)
pub type JwksLocation {
  ByValue(value: jwk.JwkSet)
  ByUri(value: uri.Uri)
  NoJwks
}

Constructors

pub type RequestError {
  InvalidUri(uri: uri.Uri)
}

Constructors

pub type ResponseError {
  MalformedMessageBody(json.DecodeError)
  ErrorResponse(
    status: Int,
    error: String,
    error_description: option.Option(String),
  )
  UnsupportedContent(content_type: String)
}

Constructors

  • MalformedMessageBody(json.DecodeError)
  • ErrorResponse(
      status: Int,
      error: String,
      error_description: option.Option(String),
    )
  • UnsupportedContent(content_type: String)
pub type ResponseType {
  Code
  Token
  OtherResponseType(name: String)
}

Constructors

  • Code
  • Token
  • OtherResponseType(name: String)
pub type TokenEndpointAuthMethod {
  NoAuthMethod
  ClientSecretPost
  ClientSecretBasic
  OtherTokenEndpointAuthMethod(name: String)
}

Constructors

  • NoAuthMethod
  • ClientSecretPost
  • ClientSecretBasic
  • OtherTokenEndpointAuthMethod(name: String)

Values

pub fn client_metadata_to_json(
  client_metadata: ClientMetadata,
) -> json.Json
pub fn parse_client_registration_response(
  response resp: response.Response(String),
) -> Result(ClientInformationResponse, ResponseError)
pub fn to_http_request(
  client_registration_request: ClientRegistrationRequest,
) -> Result(request.Request(String), RequestError)
Search Document