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

# Implementing the OAuth 2.0 Client Using a Library

export const WarningCallout = ({title, children}) => <div className="callout-box callout-warning">
    <div className="callout-row">
      <span className="callout-badge">
        <svg width="18" height="18" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M215.46,216H40.54C27.92,216,20,202.79,26.13,192.09L113.59,40.22c6.3-11,22.52-11,28.82,0l87.46,151.87C236,202.79,228.08,216,215.46,216Z" opacity="0.2" /><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z" /></svg>
      </span>
      <div>
        {title && <div className="callout-title">
            {title}
          </div>}
        <div className="callout-body">
          {children}
        </div>
      </div>
    </div>
  </div>;

export const NoteCallout = ({title, children}) => <div className="callout-box callout-note">
    <div className="callout-row">
      <span className="callout-icon">
        <svg width="22" height="22" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,104a79.86,79.86,0,0,1-30.59,62.92A24.29,24.29,0,0,0,168,186v6a8,8,0,0,1-8,8H96a8,8,0,0,1-8-8v-6a24.11,24.11,0,0,0-9.3-19A79.87,79.87,0,0,1,48,104.45C47.76,61.09,82.72,25,126.07,24A80,80,0,0,1,208,104Z" opacity="0.2" /><path d="M176,232a8,8,0,0,1-8,8H88a8,8,0,0,1,0-16h80A8,8,0,0,1,176,232Zm40-128a87.55,87.55,0,0,1-33.64,69.21A16.24,16.24,0,0,0,176,186v6a16,16,0,0,1-16,16H96a16,16,0,0,1-16-16v-6a16,16,0,0,0-6.23-12.66A87.59,87.59,0,0,1,40,104.49C39.74,56.83,78.26,17.14,125.88,16A88,88,0,0,1,216,104Zm-16,0a72,72,0,0,0-73.74-72c-39,.92-70.47,33.39-70.26,72.39a71.65,71.65,0,0,0,27.64,56.3A32,32,0,0,1,96,186v6h64v-6a32.15,32.15,0,0,1,12.47-25.35A71.65,71.65,0,0,0,200,104Zm-16.11-9.34a57.6,57.6,0,0,0-46.56-46.55,8,8,0,0,0-2.66,15.78c16.57,2.79,30.63,16.85,33.44,33.45A8,8,0,0,0,176,104a9,9,0,0,0,1.35-.11A8,8,0,0,0,183.89,94.66Z" /></svg>
      </span>
      <div>
        {title && <div className="callout-title">
            {title}
          </div>}
        <div className="callout-body">
          {children}
        </div>
      </div>
    </div>
  </div>;

<WarningCallout title="This page has now been ARCHIVED. Please visit:">
  * **[OAuth 2.0 Setup Workflow Guide](/docs/current/guides/oauth-workflow-guide)**
</WarningCallout>

Many open source libraries offer high-quality implementations of OAuth 2.0 clients. They are available in a variety of programming languages, offering support for various web frameworks and database backends.

<NoteCallout title="Note">
  Where to start. A list of open-source OAuth 2.0 client libraries is available at [https://oauth.net/code/](https://oauth.net/code/).
</NoteCallout>

We strongly recommend using one of these libraries instead of implementing OAuth 2.0 from scratch. Examples are:

* **Java**: spring-security-oauth2-client, Apache OLTu
* **Python**: authlib, Requests-OAuthlib
* **JavaScript**: passport.js, oidc-client-js
* **.NET**: Microsoft.Identity.Web

## Implementing OAuth 2.0 Client Using a Library

Libraries providing OAuth 2.0 implementation often allow customisation to some extent - allow to plug in custom implementations for front-end and back-end interfaces they provide.

Most often, when using a library, a developer can:

Benefits of using a library:

* Configure the client with specific authorisation server: provide the authorisation and token endpoints, configure supported client authentication methods, and protocol extensions.
* Provide the User Interface (UI) for initiating the authentication flow (**connect to Pleo** button), and connect it to functions and methods of the library that generate all necessary authentication request parameters.
* Integrate the library with the web framework of choice to allow it to perform HTTP redirects.
* Provide implementation for persistence backend, allowing the client library to store and retrieve parameters, such as `code_verifier` and `state`. Also, generate access and refresh tokens.
* Provide custom UI for handling success and error responses from the authorisation server.
* Listen to events emitted during flow and extend various stages.

<NoteCallout title="Note">
  Details and capabilities of OAuth 2.0 implementations depend of the library
  your are selecting. Consult the documentation of the specific library you
  have selected.
</NoteCallout>

## Related Topics

* [OAuth 2.0 Implementation Reference Documentation](/docs/oauth-implementation-reference-documentation): Refer to this document to understand how the OAuth 2.0 authentication method is implemented.
