メインコンテンツにスキップ

概要

このセクションでは、アプリケーションをCasdoorに接続する方法をご紹介します。

サービスプロバイダー(SP)として、Casdoorは2つの認証プロトコルをサポートしています:

  • OAuth 2.0 (OIDC)
  • SAML

アイデンティティプロバイダー(IdP)として、Casdoorは4つの認証プロトコルをサポートしています:

  • OAuth 2.0
  • OIDC
  • SAML
  • CAS 1.0, 2.0, 3.0

OAuth 2.0 (OIDC)

OAuth 2.0とは何ですか?

OAuth 2は、Facebook、GitHub、CasdoorなどのアプリケーションがHTTPサービス上のユーザーアカウントへの限定的なアクセスを取得することを可能にする認証フレームワークです。 It works by delegating user authentication to the service that hosts the user account and authorizing third-party applications to access that account. OAuth 2 provides authorization flows for web applications, desktop applications, and mobile devices.

Casdoorの認証プロセスはOAuth 2.0プロトコルに基づいて構築されています。 We recommend using OAuth 2.0 for the following reasons:

  1. The protocol is simple, easy to implement, and can address many authentication scenarios.
  2. 成熟度が高く、広範なコミュニティサポートがあります。

したがって、アプリケーションはOAuth 2.0(OIDC)を介してCasdoorと通信します。 Casdoorに接続する方法は3つあります:

標準OIDCクライアント

Standard OIDC client: Use a standard OIDC client implementation, which is widely available in any programming language or framework.

OIDCとは何ですか?

OpenID Connect (OIDC)は、OAuth 2.0フレームワークの上で動作するオープンな認証プロトコルです。 Targeted toward consumers, OIDC allows individuals to use single sign-on (SSO) to access relying party sites using OpenID Providers (OPs), such as email providers or social networks, to authenticate their identities. It provides applications or services with information about the user, the context of their authentication, and access to their profile information.

CasdoorはOIDCプロトコルを完全にサポートしています。 アプリケーションが別のOAuth 2.0(OIDC)アイデンティティプロバイダーを標準OIDCクライアントライブラリを介して使用しており、Casdoorに移行したい場合、OIDCディスカバリーを使用すると、Casdoorに非常に簡単に切り替えることができます。

Casdoor SDK

Casdoor SDKs: For most programming languages, Casdoor provides easy-to-use SDK libraries built on top of OIDC, with extended functionality that is only available in Casdoor.

Compared to the standard OIDC protocol, Casdoor's SDK provides additional functionality, such as user management and resource uploading. Casdoor SDKを介してCasdoorに接続するには、標準OIDCクライアントライブラリを使用するよりも時間がかかりますが、最高の柔軟性と最も強力なAPIを提供します。

Casdoorプラグイン

Casdoor plugin: If your application is built on top of a popular platform (such as Spring Boot, WordPress, etc.) and Casdoor (or a third party) has already provided a plugin or middleware for it, you should use it. Using a plugin is much easier than manually invoking the Casdoor SDK because plugins are specifically designed for their target platform.

プラグイン:

ミドルウェア:

SAML

SAMLとは何ですか?

セキュリティアサーションマークアップ言語(SAML)は、アイデンティティプロバイダー(IdP)がサービスプロバイダー(SP)に認証情報を渡すことを可能にするオープンスタンダードです。 This means you can use one set of credentials to log into many different websites. It's much simpler to manage one login per user than to manage separate logins for email, customer relationship management (CRM) software, Active Directory, etc.

SAMLトランザクションは、アイデンティティプロバイダーとサービスプロバイダー間の標準化された通信のために、拡張可能マークアップ言語(XML)を使用します。 SAMLは、ユーザーのアイデンティティの認証とサービスの使用許可をリンクするものです。

CasdoorはSAML IdPとして使用できます。 現在、CasdoorはSAML 2.0の主要な機能をサポートしています。 詳細については、SAMLを参照してください。

例:

CasdoorをKeycloakのSAML IdPとして

提案:

  1. プロトコルは強力であり、多くのシナリオをカバーしているため、最も包括的なSSOプロトコルの1つです。
  2. プロトコルは大きく、多くのオプションパラメーターがあるため、実際の実装で100%すべてのアプリケーションシナリオをカバーすることは困難です。
  3. アプリケーションが新しく開発された場合、技術的な複雑さが高いためSAMLは推奨されません

CAS

CASとは何ですか?

Central Authentication Service(CAS)は、ウェブ用のシングルサインオンプロトコルです。 その目的は、ユーザーがユーザーIDやパスワードなどの資格情報を1回だけ提供することで、複数のアプリケーションにアクセスできるようにすることです。 また、ウェブアプリケーションがユーザーのセキュリティ資格情報、例えばパスワードなどにアクセスすることなく、ユーザーを認証することを可能にします。

CasdoorはCAS 1.0、2.0、および3.0の機能を実装しています。 詳細については、CASを参照してください。

提案:

  1. プロトコル自体は比較的軽量で実装が容易ですが、単一のシナリオのみを解決することができます。
  2. CASクライアントとCASサーバー間の相互信頼は、さらなるセキュリティを保証するための暗号化や署名メカニズムなしにインターフェース呼び出しを通じて確立されます。
  3. CASプロトコルは他のプロトコルに対して利点がありません。

統合テーブル

すでにCasdoorに接続する例があるアプリケーションがいくつかあります。 ドキュメントに従って、Casdoorにすばやく接続することができます。 統合テーブルですべてのアプリケーションを見ることができます。