cloudfoundry / cloudfoundry/cf-java-client
Authentication issues from Cloud foundry V2
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Java
- Estrellas
- 334
- Forks
- 319
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hello everyone, we are using the cloud foundry V2 client for creating/updating Hana Cloud service instances.
The error is
unauthorized: {"error":"invalid_grant","error_description":"User authentication failed: Unauthorized"}
We have a spring boot app and they way we initialize our CF client is with a @Configuration class on application start.
@Bean
public DefaultConnectionContext connectionContext() {
String cfApi = CfToolsHelper.getCfApi();
String host = cfApi.substring(cfApi.lastIndexOf("/") + 1);
return DefaultConnectionContext.builder().apiHost(host).build();
}
@Bean
CloudFoundryClient cloudFoundryClient(ConnectionContext connectionContext, TokenProvider tokenProvider) {
return ReactorCloudFoundryClient.builder()
.connectionContext(connectionContext)
.tokenProvider(tokenProvider)
.build();
}
@Bean
ReactorDopplerClient dopplerClient(ConnectionContext connectionContext, TokenProvider tokenProvider) {
return ReactorDopplerClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
}
@Bean
ReactorUaaClient uaaClient(ConnectionContext connectionContext, TokenProvider tokenProvider) {
return ReactorUaaClient.builder().connectionContext(connectionContext).tokenProvider(tokenProvider).build();
}
We have a technical user and for the authentication we user username and x509 certificate. With it we create a one-time, 5 minute-living passcode with which we create initialize a bean of PasswordGrantTokenProvider:
return PasswordGrantTokenProvider.builder().password(passcode).username(username).build();
which is used for the init of the client above. After that we do not re-initialize PasswordGrantTokenProvider during the lifetime of the app.
We haven't seen any concrete dependency on why and when the error is thrown. E.g. after application start there can be multiple successful executions in the timespan of several hours, but after that it start failing(here I cannot say if from this point on it fails every time or if there can still be successful executions after the first failure, but for sure it fails more than not).
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con los métodos @Bean que crean DefaultConnectionContext, CloudFoundryClient, ReactorDopplerClient, ReactorUaaClient y PasswordGrantTokenProvider. Traza cómo se utilizan el código de acceso de cinco minutos y el proveedor de tokens durante las solicitudes posteriores, y luego reproduce el fallo de autenticación retrasado. Se considera terminado cuando se identifica la causa relacionada con el ciclo de vida o la actualización y se documenta o valida una resolución fiable.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, spring-boot
- Área
- authentication, cloud
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100