use of com.nexblocks.authguard.service.model.ApiKeyBO in project AuthGuard by AuthGuard.
the class ApiKeysServiceImpl method generateApiKey.
@Override
public ApiKeyBO generateApiKey(final AppBO app) {
final AuthResponseBO token = apiKeyExchange.generateKey(app);
final String generatedKey = (String) token.getToken();
final ApiKeyBO persisted = create(ApiKeyBO.builder().appId(app.getId()).key(apiKeyHash.hash(generatedKey)).build());
// we store the hashed version but we return back the clear version
return persisted.withKey(generatedKey);
}
Aggregations