Chapter 53. OAuth Validator Modules

Table of Contents

53.1. Safely Designing a Validator Module
53.1.1. Validator Responsibilities
53.1.2. General Coding Guidelines
53.1.3. Authorizing Users (Usermap Delegation)
53.2. Initialization Functions
53.3. OAuth Validator Callbacks
53.3.1. Startup Callback
53.3.2. Validate Callback
53.3.3. Shutdown Callback

Postgres Pro provides infrastructure for creating custom modules to perform server-side validation of OAuth bearer tokens. Because OAuth implementations vary so wildly, and bearer token validation is heavily dependent on the issuing party, the server cannot check the token itself; validator modules provide the integration layer between the server and the OAuth provider in use.

OAuth validator modules must at least consist of an initialization function (see Section 53.2) and the required callback for performing validation (see Section 53.3.2).

Warning

Since a misbehaving validator might let unauthorized users into the database, correct implementation is crucial for server safety. See Section 53.1 for design considerations.