keycloak-rest-api

How to integrate keycloak sms authentication by API?

对着背影说爱祢 提交于 2021-02-10 18:37:51
问题 I have a keycloak server and Laravel application using custom KeycloakProvider: public function loginByEmail(string $email, string $password): SsoTokens { try { $data = $this->realmEndpoint->makeRequest( HttpClientProvider::METHOD_POST, self::KEYCLOAK_AUTH_URL, [ 'client_id' => config('services.keycloak.realm_client'), 'client_secret' => config('services.keycloak.realm_secret'), 'grant_type' => 'password', 'username' => $email, 'password' => $password, 'scope' => 'openid' ] ); } catch

How do I configure Keycloak and get a JWT with all steps done through the REST API?

对着背影说爱祢 提交于 2021-01-07 01:59:35
问题 I need to configure Keycloak running in Docker with a realm, a user with credentials, and a client and then get a JWT as in this blog post. If I use the UI as shown it works, but I need to automate all steps through the Keycloak REST API. When I do that all steps seem to work but getting a JWT fails. I run Keycloak in Docker like this docker network create keycloak-network docker run --name mysql -d \ --net keycloak-network \ -e MYSQL_DATABASE=keycloak \ -e MYSQL_USER=keycloak \ -e MYSQL