> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.mysoleas.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authorize a sign-in

> Redirect a user to Sign in with Mysoleas with OAuth2 and PKCE.

This endpoint starts the **Sign in with Mysoleas** flow.

Before calling this endpoint, the user must have a Mysoleas account and create an OAuth2 application from the dashboard:

```txt theme={null}
https://mysoleas.com
```

The dashboard lets you configure the `client_id`, allowed redirect URLs, scopes, and the information displayed during consent.

Your application redirects the user there with `client_id`, `redirect_uri`, `scope`, `state`, and PKCE parameters. After authentication and consent, Mysoleas sends a `code` to your `redirect_uri`.

Then exchange this `code` for a JWT through `/oauth/v2/token`.

You can use this JWT to open a session in your own application. If you then call the Mysoleas gateway, send it in `x-sp-auth-token`.


## OpenAPI

````yaml en/api-reference/openapi.json GET /oauth/v2/authorize
openapi: 3.1.0
info:
  title: Mysoleas API
  version: 3.0.0
  description: >-
    New Mysoleas architecture: business gateway, Mysoleas Identity Cloud, and
    SoleasPay ecosystem.
servers:
  - url: https://api.mysoleas.com
    description: Mysoleas gateway
  - url: https://account.mysoleas.com
    description: Mysoleas authentication
security:
  - spAuthToken: []
tags:
  - name: Identity Cloud
  - name: Plugin
  - name: Payment links
  - name: Subscriptions
  - name: Collections
  - name: Disbursements
  - name: Verification
  - name: Catalog
paths:
  /oauth/v2/authorize:
    get:
      tags:
        - Identity Cloud
      summary: Start Sign in with Mysoleas
      description: >-
        Redirects the user to Mysoleas Identity Cloud for OAuth2/OIDC
        authentication with PKCE. The OAuth2 application must be created and
        configured beforehand in the https://mysoleas.com dashboard.
      parameters:
        - name: client_id
          in: query
          required: true
          schema:
            type: string
          description: Identifiant de l'application OAuth.
        - name: redirect_uri
          in: query
          required: true
          schema:
            type: string
            format: uri
          description: URL de retour autorisee pour l'application.
        - name: response_type
          in: query
          required: true
          schema:
            type: string
            enum:
              - code
          description: Use `code` for the authorization code flow.
        - name: scope
          in: query
          required: true
          schema:
            type: string
          description: Scopes demandes, par exemple `openid profile email payments`.
        - name: state
          in: query
          required: true
          schema:
            type: string
          description: Valeur aleatoire que votre application verifie au retour.
        - name: code_challenge
          in: query
          required: true
          schema:
            type: string
          description: Challenge PKCE genere par votre application.
        - name: code_challenge_method
          in: query
          required: true
          schema:
            type: string
            enum:
              - S256
          description: Methode PKCE recommandee.
      responses:
        '302':
          description: Redirection vers `redirect_uri` avec un `code` OAuth2 ou une erreur.
      security: []
      servers:
        - url: https://account.mysoleas.com
components:
  securitySchemes:
    spAuthToken:
      type: apiKey
      in: header
      name: x-sp-auth-token
      description: >-
        JWT Bearer emis par Mysoleas Identity Cloud. Format: Bearer
        <access_token>.

````