Zum Hauptinhalt springen

MinIO

MinIO unterstützt externe Identitätsverwaltung mit einem OpenID Connect (OIDC)-kompatiblen Anbieter. Dieses Dokument behandelt die Konfiguration von Casdoor als Identitätsanbieter zur Unterstützung von MinIO.

Schritt 1: Casdoor & MinIO bereitstellen

Zuerst Casdoor bereitstellen.

See Server installation.

Nach einer erfolgreichen Bereitstellung stellen Sie sicher, dass:

  • The Casdoor server is running on http://localhost:8000.
  • Open your favorite browser and visit http://localhost:7001 to see the login page of Casdoor.
  • Testen Sie die Anmeldefunktionalität, indem Sie admin und 123 eingeben.

Implement a Casdoor-based login in your app with the following steps.

Deploy MinIO: MinIO quickstart. Install the mc client: MinIO mc.

Schritt 2: Casdoor-Anwendung konfigurieren

  1. Erstellen Sie eine neue Casdoor-Anwendung oder verwenden Sie eine vorhandene.

  2. Fügen Sie Ihre Weiterleitungs-URL hinzu.Casdoor Anwendungseinstellungen

  3. Fügen Sie den Anbieter hinzu, den Sie möchten, und stellen Sie die notwendigen Einstellungen bereit.

    Note Client ID and Client secret for the next step. OIDC discovery: http://<CASDOOR_HOSTNAME>/.well-known/openid-configuration.

  4. Dieser Schritt ist notwendig für MinIO. Da MinIO ein Anspruchsattribut in JWT für seine Richtlinie verwenden muss, sollten Sie dies auch in Casdoor konfigurieren. Derzeit verwendet Casdoor tag als Workaround für die Konfiguration der MinIO-Richtlinie.

    MinIO Richtlinieneinstellung

    See MinIO policy-based access control for supported policies.

Schritt 3: MinIO konfigurieren

Start a MinIO server, for example:

export MINIO_ROOT_USER=minio
export MINIO_ROOT_PASSWORD=minio123
minio server /mnt/export

Use --console-address to set the console address and port.

Als Nächstes fügen Sie einen Dienstalias mit dem MinIO-Client mc hinzu.

mc alias set myminio <Ihre Konsolenadresse> minio minio123

Jetzt konfigurieren Sie das OpenID Connect von MinIO. Für Casdoor lautet der Befehl:

mc admin config set myminio identity_openid config_url="http://CASDOOR_HOSTNAME/.well-known/openid-configuration" client_id=<client id> client_secret=<client secret> claim_name="tag"

See the MinIO OpenID identity management docs for more parameters.

Nach erfolgreicher Einstellung starten Sie die MinIO-Instanz neu.

mc admin service restart myminio

Schritt 4: Probieren Sie die Demo aus!

Öffnen Sie jetzt Ihre MinIO-Konsole im Browser und klicken Sie auf Login with SSO.

You are redirected to the Casdoor login page; after sign-in, back to MinIO and logged in. You then see the buckets and objects available to you.

Vorsicht

If the Casdoor frontend and backend use different ports, the redirect may hit the backend and show 404. Point the redirect URL to the frontend port so the login page loads correctly.