cloudfoundry / cloudfoundry/cf-java-client
Authentication issues from Cloud foundry V2
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 334
- Fork
- 319
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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).
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con i metodi @Bean che creano DefaultConnectionContext, CloudFoundryClient, ReactorDopplerClient, ReactorUaaClient e PasswordGrantTokenProvider. Traccia il modo in cui il passcode di cinque minuti e il provider del token vengono utilizzati durante le richieste successive, quindi riproduci il problema di autenticazione ritardato. Il lavoro è completato quando viene identificata la causa legata al ciclo di vita o al rinnovo e viene documentata o convalidata una soluzione affidabile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java, spring-boot
- Ambito
- authentication, cloud
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100