File tree Expand file tree Collapse file tree
src/main/scala/com/tesobe/oidc/endpoints Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,13 +148,18 @@ class RegistrationEndpoint(
148148
149149 // Persist the client
150150 authService.createClient(oidcClient).flatMap {
151- case Right (_) =>
152- logger.info(s " Successfully registered client: $clientId ( ${validatedRequest.client_name}) " )
151+ case Right (createdClient) =>
152+ // Use the client_id and secret from the created client.
153+ // When created via OBP API, these come from the OBP consumer
154+ // (consumer_key/consumer_secret) rather than the locally generated ones.
155+ val effectiveClientId = createdClient.client_id
156+ val effectiveClientSecret = createdClient.client_secret.getOrElse(clientSecret)
157+ logger.info(s " Successfully registered client: $effectiveClientId ( ${validatedRequest.client_name}) " )
153158
154159 // Build response
155160 val response = ClientRegistrationResponse (
156- client_id = clientId ,
157- client_secret = Some (clientSecret ),
161+ client_id = effectiveClientId ,
162+ client_secret = Some (effectiveClientSecret ),
158163 client_id_issued_at = issuedAt,
159164 client_secret_expires_at = 0 , // Never expires
160165 client_name = validatedRequest.client_name,
You can’t perform that action at this time.
0 commit comments