Skip to content
Snippets Groups Projects
Commit c1e213a0 authored by Jan Zickermann's avatar Jan Zickermann
Browse files

#3 OZG-7112 readme: Explain ServiceKonto Auth

parent c558e718
No related branches found
No related tags found
1 merge request!3Resolve "Anmeldung am Servicekonto & Token Erstellung"
Pipeline #1165 passed
# OSIv2-Postfach-Anbindung für OZG-Cloud-Nachrichten
Anbindung des OSIv2-Postfachs für die OZG-Cloud.
## Client-Authentifizierung beim Servicekonto
Die Client-Authentifizierung beim Authentication-Server (Servicekonto) erfolgt über den OAuth2-Client-Credentials-Flow (siehe [RFC 6749, Sec. 1.3.4](https://www.rfc-editor.org/rfc/rfc6749#section-1.3.4))
mit `client_id` und `client_secret` in Verbindung mit einem Resource-URI-Parameter (siehe [RFC 8707](https://datatracker.ietf.org/doc/html/rfc8707)), der den Zugriff des Clients auf den Resource-Server (Postfach-Facade) einschränkt.
Der Resource-Server liest die Resource-URI aus dem `aud`-Claim (siehe [RFC 9068, Sec. 3](https://datatracker.ietf.org/doc/html/rfc9068#section-3)).
### Beispiel:
```bash
curl -v --output auth_response.json \
-H "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_id=OZG-Kopfstelle" \
--data-urlencode "client_secret=${SH_STAGE_CLIENT_SECRET}" \
--data-urlencode "scope=default access_urn:dataport:osi:sh:stage:ozgkopfstelle" \
--data-urlencode "resource=urn:dataport:osi:postfach:rz2:stage:sh" \
https://idp.serviceportal-stage.schleswig-holstein.de/webidp2/connect/token
```
**Beobachtungen:**
- <small>Mit einem ungültigen `resource`-Parameter kommt ein `invalid_target`-Fehler bei der Token-Erstellung.</small>
- <small>Ohne `resource`-Parameter (d.h. ohne `aud`-Claim) kommt `401 Unauthorized` von der Postfach-Facade.</small>
- <small>Ohne `default`-Scope kommt ein `invalid_target`-Fehler bei der Token-Erstellung</small>
- <small>Ohne `access_urn:dataport:osi:sh:stage:ozgkopfstelle` kommt ein `Internal Server Error 500` von der Postfach-Facade.</small>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment