Liferay Authentication with OAuth2 — Complete Guide
Modern applications rarely authenticate users directly. They delegate authentication to trusted identity providers like Google, Azure AD, or Keycloak using OAuth2 . In Liferay , OAuth2 allows secure Single Sign-On (SSO) across microservices and external apps. This guide explains how OAuth2 works in Liferay and how to configure it . 📌 What is OAuth2 in Liferay? OAuth2 enables: External login (Google / Azure / IdP) Secure API access Token-based authentication Decoupled frontend & backend Instead of sending passwords → apps exchange access tokens . đź–Ľ️ OAuth2 Authentication Flow 4 đź§ OAuth2 Roles Role Description Resource Owner User Client Liferay Authorization Server Identity Provider Resource Server APIs đź› Step 1 — Enable OAuth2 in Liferay Go to: Control Panel → Security → OAuth2 Administration Create a new OAuth2 Application. đź› Step 2 — Configure Client Fill: Name Client ID Client Secret Redirect URI Example: http://localhost:8080/c/portal/oauth2/redirect đź–Ľ️ OAuth2 Co...