Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/felipementel/poc.keycloak.v1
https://github.com/felipementel/poc.keycloak.v1
dotnet keycloak keycloak-health keycloak-metrics
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/felipementel/poc.keycloak.v1
- Owner: felipementel
- License: apache-2.0
- Created: 2024-07-24T16:28:26.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-25T16:31:52.000Z (6 months ago)
- Last Synced: 2024-11-06T04:08:23.939Z (2 months ago)
- Topics: dotnet, keycloak, keycloak-health, keycloak-metrics
- Language: C#
- Homepage:
- Size: 1.01 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Segurança de API com KeyCloak
![banner](./docs/img/banner.png)
## Pré requisito
- Docker e Docker compose
- .NET 8 SDK- Criação do Realm
- Menu: Client
Criar o Client \* Deixar o "Client Authentication" Marcado- Menu: Client scopes
Criar um novo scope \* Deixar o "Include in token scope" marcado- Mappers - Configure new mapper
- Selecionar o "Audience" e depois coloque um nome- Voltar na tela do "Clients" depois clicar na aba "Client scopes" e depois no botão "Add client scope"
- Menu User
Criar um novo User
Clicar no user criado, aba Credentials, criar uma senha. Não deixar marcado a aba Temporary```curl
curl --location --request POST 'http://localhost:8080/realms//protocol/openid-connect/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=password' --data-urlencode 'client_id=' --data-urlencode 'client_secret=' --data-urlencode 'username=' --data-urlencode 'password='
``````javascript
var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable('token', jsonData.access_token);
```