fastapi-keycloak
fastapi-keycloak copied to clipboard
Create clients from library
Hello there, thank you for this library that looks great.
I haven't found the possibility to create clients programmatically directly from the library, is it something planned? If not, I might open a PR to do so.
Hi @GratienDSX , I think it's possible to create clients programmatically it'll be something like this
idp = FastAPIKeycloak(
server_url="http://localhost:8085/auth",
client_id="test-client",
client_secret="GzgACcJzhzQ4j8kWhmhazt7WSdxDVUyE",
admin_client_secret="BIcczGsZ6I8W5zf0rZg5qSexlloQLPKB",
realm="Test",
callback_uri="http://localhost:8081/callback"
)
idp.create_user(first_name=first_name, last_name=last_name, username=email, email=email, \
password=password.get_secret_value(), id=id)