Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Page updated Jun 19, 2024

Use OpenID Connect as an authorization provider

Private, owner, and group authorization can be configured with an OpenID Connect (OIDC) authorization mode. Add "oidc" to the authorization rule as the provider. Use the oidcAuthorizationMode property to configure the OpenID Connect provider name, OpenID Connect provider domain, Client ID, Issued at TTL, and Auth Time TTL.

The example below highlights the supported authorization strategies with a oidc authorization provider. For owner and group-based authorization, you also will need to specify a custom identity and group claim.

// amplify/data/resource.ts
import { a, defineData, type ClientSchema } from '@aws-amplify/backend';
const schema = a.schema({
Todo: a
content: a.string(),
.authorization(allow => [
.groups(['testGroupName'], 'oidc')
export type Schema = ClientSchema<typeof schema>;
export const data = defineData({
authorizationModes: {
defaultAuthorizationMode: 'oidc',
oidcAuthorizationMode: {
oidcProviderName: 'oidc-provider-name',
oidcIssuerUrl: '',
clientId: 'client-id',
tokenExpiryFromAuthInSeconds: 300,
tokenExpireFromIssueInSeconds: 600,

In your application, you can perform CRUD operations against the model using client.models.<model-name> by specifying the oidc auth mode.

import { generateClient } from 'aws-amplify/data';
import type { Schema } from '../amplify/data/resource'; // Path to your backend resource definition
const client = generateClient<Schema>();
const { errors, data: todos } = await client.models.Todo.list({
authMode: "oidc",