0Pricing
OAuth2 & OpenID Connect Deep Dive · 강의

OIDC를 사용한 암시적 흐름

OIDC를 사용하는 암시적 흐름에서 ID 토큰을 직접 반환하는 방식과 단일 페이지 애플리케이션에 미치는 보안 영향을 살펴보세요.

OIDC를 사용한 암시적 흐름은(는) CoddyKit의 무료 OAuth2 & OpenID Connect Deep Dive 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 OAuth2 & OpenID Connect Deep Dive 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. OAuth2 & OpenID Connect Deep Dive 강의에는 총 4개의 강의가 포함되어 있습니다.

이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.

OIDC Implicit Flow Basics

What is the Implicit Flow with OpenID Connect (OIDC)? It's a way for web applications, especially Single-Page Applications (SPAs), to get identity information and access tokens directly from the authorization server.

It was designed for scenarios where a backend server couldn't securely store a client secret.

Direct Token Delivery

Unlike the Authorization Code Flow, the Implicit Flow doesn't involve an authorization code exchange with the authorization server's token endpoint.

Instead, the ID Token and Access Token are returned directly to the client's browser in the URL fragment after user authentication.

Requesting Tokens Directly

The client application initiates the flow by redirecting the user's browser to the Authorization Server's /authorize endpoint.

Key parameters include:

  • response_type=id_token token: Requests both an ID Token and an Access Token.
  • client_id: Identifies the client application.
  • redirect_uri: Where the user is sent back after authentication.
  • scope=openid profile: Specifies requested permissions, including openid for OIDC.
  • nonce: A unique string to prevent replay attacks.
https://auth.example.com/authorize?
  response_type=id_token%20token&
  client_id=my-spa-client&
  redirect_uri=https://app.example.com/callback&
  scope=openid%20profile&
  nonce=aRandomNonceValue&
  state=aRandomStateValue

Tokens in the URL Fragment

After the user successfully authenticates and grants consent, the Authorization Server redirects the user's browser back to the redirect_uri.

The tokens (ID Token and Access Token) are included directly in the URL's fragment part (after the # symbol).

The client-side JavaScript then reads and processes these tokens.

https://app.example.com/callback#
  id_token=eyJ...&
  access_token=eyJ...&
  token_type=Bearer&
  expires_in=3600&
  state=aRandomStateValue

Client-Side Token Processing

Since the tokens are in the URL fragment, they are accessible to client-side JavaScript. The browser does not send the fragment to the server.

The SPA extracts the id_token and access_token, validates them, and can then use the access_token to make requests to protected API resources.

public class TokenParser {
  public static void main(String[] args) {
    String urlFragment = "id_token=eyJ...&access_token=eyJ...&expires_in=3600";
    System.out.println("Processing URL fragment:");
    String[] params = urlFragment.split("&");
    for (String param : params) {
      String[] pair = param.split("=");
      if (pair.length == 2) {
        System.out.println(pair[0] + ": " + pair[1]);
      }
    }
    System.out.println("\nIn a real app, you'd validate these tokens!");
  }
}

Identity with the ID Token

The ID Token is a JSON Web Token (JWT) that contains claims about the authenticated user, such as their unique identifier, name, and email.

The client application validates this token to verify the user's identity and ensures it came from the expected Authorization Server.

This is the "identity layer" OpenID Connect adds to OAuth2.

Security Risk: Browser History

A major security concern with the Implicit Flow is that tokens are exposed in the browser's URL fragment.

This means they can be stored in browser history, server access logs (if the fragment is accidentally included), and potentially accessed by other scripts on the same page.

  • Browser History: Tokens might be saved, allowing unauthorized access if someone gains access to the browser history.
  • Referrer Headers: In some cases, tokens could leak via Referrer headers.

Security Risk: No Client Secret

The Implicit Flow is typically used by "public clients" (like SPAs) that cannot securely store a client secret.

This means the Authorization Server cannot authenticate the client application itself, only the user. This makes it vulnerable to certain attacks, such as token injection.

  • An attacker could potentially inject a malicious token.
  • There's no cryptographic proof that the client receiving the token is the one that initiated the request.

Discouraged & Replaced

Due to its inherent security weaknesses, the Implicit Flow is now largely deprecated for new implementations.

The OAuth 2.0 Security Best Current Practice recommends using the Authorization Code Flow with PKCE (Proof Key for Code Exchange) for public clients like SPAs and mobile apps.

PKCE provides a robust way to secure public clients without requiring a client secret.

Implicit Flow Quick Check

Which of the following is a primary security concern when using the OIDC Implicit Flow?

Implicit Flow Recap

We've explored the OIDC Implicit Flow, where identity and access tokens are returned directly in the URL fragment.

While it simplifies client-side access, its security risks, primarily token exposure in the URL and lack of client authentication, have led to its deprecation.

Always prefer the Authorization Code Flow with PKCE for public clients to ensure robust security.

자주 묻는 질문

“OIDC를 사용한 암시적 흐름” 강의는 무료인가요?

네 — “OIDC를 사용한 암시적 흐름” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 OAuth2 & OpenID Connect Deep Dive 강의 전체를 잠금 해제할 수 있습니다. OAuth2 & OpenID Connect Deep Dive 강의에는 총 4개의 강의가 포함되어 있습니다.

“OIDC를 사용한 암시적 흐름”에서 뭘 배우나요?

OIDC를 사용하는 암시적 흐름에서 ID 토큰을 직접 반환하는 방식과 단일 페이지 애플리케이션에 미치는 보안 영향을 살펴보세요. 브라우저에서 직접 실행하는 실습 코드로 OAuth2 & OpenID Connect Deep Dive을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.

OAuth2 & OpenID Connect Deep Dive을(를) 시작하는 데 경험이 필요한가요?

사전 경험은 필요하지 않습니다. CoddyKit의 OAuth2 & OpenID Connect Deep Dive은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.

“OIDC를 사용한 암시적 흐름” 강의는 얼마나 걸리나요?

대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.

이 OAuth2 & OpenID Connect Deep Dive 강의에서 코드를 작성하고 실행할 수 있나요?

네. 모든 OAuth2 & OpenID Connect Deep Dive 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.

이 강의의 모든 강의

  1. OIDC를 사용한 권한 부여 코드 흐름
  2. OIDC를 사용한 암시적 흐름
  3. OIDC를 사용한 하이브리드 흐름
  4. 재생 공격 방지를 위한 nonce 사용
← OAuth2 & OpenID Connect Deep Dive(으)로 돌아가기