adorsys / adorsys/keycloak-config-cli

KeyProvider Import

Aberta
#1,656 2 comentários 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Java
Estrelas
1.2k
Forks
200
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

### Current Behavior

Hi,

I am trying to import a KeyProvider.

Image

In the screenshot you can see what the import file looks like. The content of the private key is a variable substitution. The original declaration is:
`"$(file:UTF-8:$(env:SIGNING_PRIVATE_KEY_A_PATH))"`

Image

The newlines of the PEM file are not correctly parsed by the yaml parser. As you can see after the
`-----BEGIN PRIVATE KEY-----` there is a space but it has to be a newline character. This leads to an error in keycloak:
`Failed to decode private key`

### Expected Behavior

The contents of the file are correctly parsed and imported in keycloak.

### Steps To Reproduce

```markdown
Create a valid import file for component and KeyProvider

Insert a valid private key.

Try to import

Example file:
https://gist.github.com/inituser123/f8cfc723e017413dfe83ca28e1f456b9
```

### Deployment Method

Docker

### Environment

- Keycloak Version: [26.6.2]
- keycloak-config-cli Version: [6.5.0-26.5.4]
- Java Version: [21]

### Relevant configuration (sanitized)

```yaml

```

### Logs / error output

```shell

```

### Anything else?

The error is most probably in the `KeycloakImportProvider` method `readContent`. There the `String content` is loaded as `yaml`.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.