openid / AppAuth-Android

Android client SDK for communicating with OAuth 2.0 and OpenID Connect providers.
https://openid.github.io/AppAuth-Android
Apache License 2.0
2.82k stars 881 forks source link

redirect_uri is not handled by any activity in this app! #321

Open kevgilmore opened 6 years ago

kevgilmore commented 6 years ago

I get this error when building the demo app for the first time. I checked the files it told me to and can't see anything wrong.

screenshot from 2018-03-21 14-33-00 Configured the following details

AndroidManifest.xml

            <intent-filter>
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:scheme="http://192.168.0.147:8180/auth"
                  android:host="appauth.demo-app.io"
                  android:path="/oauth2redirect"/>
            </intent-filter>

auth_config.json

{
  "client_id": "android-app",
  "redirect_uri": "io.demo-app.appauth://oauth/login_success",
  "authorization_scope": "openid email profile",
  "discovery_uri": "/realms/android-test/protocol/openid-connect/discovery",
  "authorization_endpoint_uri": "/realms/android-test/protocol/openid-connect/auth",
  "token_endpoint_uri": "/realms/android-test/protocol/openid-connect/token",
  "registration_endpoint_uri": "/realms/android-test/protocol/openid-connect/registration",
  "user_info_endpoint_uri": "/realms/android-test/protocol/openid-connect/userinfo",
  "https_required": false
}
iainmcgin commented 6 years ago

Your intent filter specification is incorrect, specifically the data spec:

<data android:scheme="http://192.168.0.147:8180/auth"
                  android:host="appauth.demo-app.io"
                  android:path="/oauth2redirect"/>

The scheme field has to be just a scheme, e.g. "http". Also, the redirect URI you specify in your auth config is inconsistent with what you've specified here. I think you want something like the following:

<data android:scheme="http"
    android:host="192.168.0.147"
    android:port="8180"
    android:pathPrefix="/auth" />

I really wouldn't recommend using an IP address, though. If possible, use a custom scheme, or a real domain which you an define an app link for.

kevgilmore commented 6 years ago

Thanks.

I believe the redirect_url is causing issues now (still same error) If my keycloak server is 192.168.0.147:8190 and my app is net.openid.appauthdemo.

It should be "net.openid.appauthdemo://oauth/login_success" right?

iainmcgin commented 6 years ago

If the identity server you are integrating with allows you to use a custom scheme, then yes, that should work. If you have not modified the build file or manifest, by default the demo app will handle any URI with scheme "net.openid.appauthdemo".

If your identity server doesn't allow the use of a custom scheme, you'll need to use an app link.

danleahy commented 6 years ago

Hi, I am having the same issue and I can see online that a lot of other people are having the same issue with this redirect URL issue.

I am hoping you guys can help me?

I have an IDP keycloak instance (4.0.0.Beta1) running on port 8080 on my local machine, I have setup various redirect URLs in keycloak and in my app

http://net.openid.appauthdemo:/oauth2redirect net.openid.appauthdemo:/oauth2redirect

based on your sample app

that don't work

I don't know how the redirect url works? you make up some unique identifier/scheme, how does the IDP know to send the response back to your app?

why doesn't the sample app pick up the response?

Do i need to register something in DNS?

Keycloak is sending an Auth code to the redirect as I had another web app that captured it for diagnostic purposes, a separate web application running on my local machine (not the the native app)

I need my android app to capture the Auth code response so it can get the OAuth token.

192.168.1.24 is the IP of my local machine so the android app can access it

if running on emulator change to 10.0.2.2

here is my auth_config.json

{ "client_id": "my-client", "redirect_uri": "http://net.openid.appauthdemo/oauth2redirect", "authorization_scope": "admin user openid email profile", "discovery_uri": "http://192.168.1.24:8080/auth/realms/demo/.well-known/openid-configuration", "authorization_endpoint_uri": "http://192.168.1.24:8080/auth/realms/demo/protocol/openid-connect/auth", "token_endpoint_uri": "http://192.168.1.24:8080/auth/realms/demo/protocol/openid-connect/token", "registration_endpoint_uri": "", "https_required": false }

Here is my intent filter from my androidmanifest.xml

below is my realm export from keycloak

What redirect URL do i need to put into Keycloak to get this to work?

How do I configure my app to accept the auth code from keycloak

demo realm export from keycloak

{ "id": "demo", "realm": "demo", "notBefore": 0, "revokeRefreshToken": false, "refreshTokenMaxReuse": 0, "accessTokenLifespan": 300, "accessTokenLifespanForImplicitFlow": 900, "ssoSessionIdleTimeout": 1800, "ssoSessionMaxLifespan": 36000, "offlineSessionIdleTimeout": 2592000, "accessCodeLifespan": 60, "accessCodeLifespanUserAction": 300, "accessCodeLifespanLogin": 1800, "actionTokenGeneratedByAdminLifespan": 43200, "actionTokenGeneratedByUserLifespan": 300, "enabled": true, "sslRequired": "external", "registrationAllowed": false, "registrationEmailAsUsername": false, "rememberMe": false, "verifyEmail": false, "loginWithEmailAllowed": true, "duplicateEmailsAllowed": false, "resetPasswordAllowed": false, "editUsernameAllowed": false, "bruteForceProtected": false, "permanentLockout": false, "maxFailureWaitSeconds": 900, "minimumQuickLoginWaitSeconds": 60, "waitIncrementSeconds": 60, "quickLoginCheckMilliSeconds": 1000, "maxDeltaTimeSeconds": 43200, "failureFactor": 30, "roles": { "realm": [ { "id": "d4b41e95-efc6-4313-b5b6-8ec880e62385", "name": "uma_authorization", "description": "${role_uma_authorization}", "scopeParamRequired": false, "composite": false, "clientRole": false, "containerId": "demo" }, { "id": "ddbfa186-456a-4289-afc1-511f3b67ffe0", "name": "admin", "scopeParamRequired": false, "composite": false, "clientRole": false, "containerId": "demo" }, { "id": "d99b6eef-2a25-430b-b2ef-6ffe0425c061", "name": "offline_access", "description": "${role_offline-access}", "scopeParamRequired": true, "composite": false, "clientRole": false, "containerId": "demo" }, { "id": "1f6b1d7f-4f9b-4e32-b4ee-c1e5ad82ca97", "name": "user", "scopeParamRequired": false, "composite": false, "clientRole": false, "containerId": "demo" } ], "client": { "my-client": [ { "id": "6fb873c1-d849-4201-aa74-57c229db1847", "name": "user", "scopeParamRequired": true, "composite": false, "clientRole": true, "containerId": "d73e211c-f7b9-4c8e-bc2f-9fc2044fdb3a" } ], "realm-management": [ { "id": "06d2d039-2a4c-4803-aedf-1848f442ee99", "name": "query-users", "description": "${role_query-users}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "6fdf4469-afd2-4ba8-a94b-140ba18b93f8", "name": "manage-realm", "description": "${role_manage-realm}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "2fc2d4f5-3aa4-4a74-a7ec-059039125df2", "name": "query-realms", "description": "${role_query-realms}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "77155a5b-66d8-47ae-b62b-2c910f8cf52b", "name": "view-realm", "description": "${role_view-realm}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "5e3ad8b3-268f-4787-b965-20a6274c6f3a", "name": "manage-events", "description": "${role_manage-events}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "8a2cbdc8-fd36-40b9-b219-5d5ac04ec888", "name": "realm-admin", "description": "${role_realm-admin}", "scopeParamRequired": false, "composite": true, "composites": { "client": { "realm-management": [ "query-users", "manage-realm", "query-realms", "view-realm", "manage-events", "manage-identity-providers", "impersonation", "manage-authorization", "manage-users", "manage-clients", "create-client", "view-clients", "view-authorization", "view-events", "query-groups", "query-clients", "view-identity-providers", "view-users" ] } }, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "6c3b3de3-d14c-4419-8443-9860696064c5", "name": "manage-identity-providers", "description": "${role_manage-identity-providers}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "c886f170-f84d-400c-be17-6ed5ac65170e", "name": "impersonation", "description": "${role_impersonation}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "03e010cb-b7d4-417d-9560-c5e7b235062e", "name": "manage-authorization", "description": "${role_manage-authorization}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "646f9b9f-338d-4f79-aee7-cf172237dda4", "name": "manage-users", "description": "${role_manage-users}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "6ef9c59b-821b-42aa-8aaf-0d667125300e", "name": "manage-clients", "description": "${role_manage-clients}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "87591430-dd27-40f6-8708-c399398f4887", "name": "create-client", "description": "${role_create-client}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "7ea52095-d465-4f43-ae15-a63ae978322f", "name": "view-clients", "description": "${role_view-clients}", "scopeParamRequired": false, "composite": true, "composites": { "client": { "realm-management": [ "query-clients" ] } }, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "5c83a606-e328-41e1-bced-5662061fe99f", "name": "view-authorization", "description": "${role_view-authorization}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "1e73b4e6-1875-4b47-956c-1fb9e7157b5a", "name": "view-events", "description": "${role_view-events}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "9a829e44-33e4-4fc1-b334-3e557e5eac30", "name": "query-groups", "description": "${role_query-groups}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "04673456-fb5f-49b2-923c-45cdcff6edde", "name": "query-clients", "description": "${role_query-clients}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "e59073ab-2d68-4cda-a7eb-719f28df95af", "name": "view-identity-providers", "description": "${role_view-identity-providers}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" }, { "id": "768c8502-274f-4a7b-9540-0a4931e76175", "name": "view-users", "description": "${role_view-users}", "scopeParamRequired": false, "composite": true, "composites": { "client": { "realm-management": [ "query-users", "query-groups" ] } }, "clientRole": true, "containerId": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b" } ], "security-admin-console": [], "admin-cli": [], "broker": [ { "id": "82632683-c199-44f2-865c-2b2356a66e9d", "name": "read-token", "description": "${role_read-token}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "7f432fc5-1d74-4dc9-8c33-1edf4e4b6908" } ], "account": [ { "id": "e19bdefa-794b-41c4-b295-1d192d284712", "name": "view-profile", "description": "${role_view-profile}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "0f7629d0-7896-4408-ad9e-3948e3d424ee" }, { "id": "23abbdb0-de2c-493e-a14e-8a77141678a8", "name": "manage-account-links", "description": "${role_manage-account-links}", "scopeParamRequired": false, "composite": false, "clientRole": true, "containerId": "0f7629d0-7896-4408-ad9e-3948e3d424ee" }, { "id": "7439adad-16cf-498a-a248-21f77dc5fa38", "name": "manage-account", "description": "${role_manage-account}", "scopeParamRequired": false, "composite": true, "composites": { "client": { "account": [ "manage-account-links" ] } }, "clientRole": true, "containerId": "0f7629d0-7896-4408-ad9e-3948e3d424ee" } ] } }, "groups": [ { "id": "545563ea-003b-4fae-8e69-8b2e6cdd86cd", "name": "admin", "path": "/admin", "attributes": {}, "realmRoles": [], "clientRoles": {}, "subGroups": [] }, { "id": "e23c4fec-171a-4267-a2ce-76f273213b5a", "name": "demo", "path": "/demo", "attributes": {}, "realmRoles": [], "clientRoles": {}, "subGroups": [] } ], "defaultRoles": [ "uma_authorization", "offline_access" ], "requiredCredentials": [ "password" ], "otpPolicyType": "totp", "otpPolicyAlgorithm": "HmacSHA1", "otpPolicyInitialCounter": 0, "otpPolicyDigits": 6, "otpPolicyLookAheadWindow": 1, "otpPolicyPeriod": 30, "otpSupportedApplications": [ "FreeOTP", "Google Authenticator" ], "clients": [ { "id": "7f432fc5-1d74-4dc9-8c33-1edf4e4b6908", "clientId": "broker", "name": "${client_broker}", "surrogateAuthRequired": false, "enabled": true, "clientAuthenticatorType": "client-secret", "secret": "**", "redirectUris": [], "webOrigins": [], "notBefore": 0, "bearerOnly": false, "consentRequired": false, "standardFlowEnabled": true, "implicitFlowEnabled": false, "directAccessGrantsEnabled": false, "serviceAccountsEnabled": false, "publicClient": false, "frontchannelLogout": false, "protocol": "openid-connect", "attributes": {}, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, "protocolMappers": [ { "id": "817bfd81-0d8b-4733-a5de-39b3e8f189b3", "name": "family name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${familyName}", "config": { "userinfo.token.claim": "true", "user.attribute": "lastName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "family_name", "jsonType.label": "String" } }, { "id": "d2665e00-b655-4219-b527-13ffc8849600", "name": "full name", "protocol": "openid-connect", "protocolMapper": "oidc-full-name-mapper", "consentRequired": true, "consentText": "${fullName}", "config": { "id.token.claim": "true", "access.token.claim": "true" } }, { "id": "0b98f147-73a3-404e-a8b9-3de9c174fe6d", "name": "username", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${username}", "config": { "userinfo.token.claim": "true", "user.attribute": "username", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "preferred_username", "jsonType.label": "String" } }, { "id": "5cd97188-0215-45e0-9e82-921a6947856e", "name": "email", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${email}", "config": { "userinfo.token.claim": "true", "user.attribute": "email", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "email", "jsonType.label": "String" } }, { "id": "8dec7a66-0a92-460b-ba82-99bb75f62a35", "name": "role list", "protocol": "saml", "protocolMapper": "saml-role-list-mapper", "consentRequired": false, "config": { "single": "false", "attribute.nameformat": "Basic", "attribute.name": "Role" } }, { "id": "07e62631-6c10-4b7d-8c46-4ff79834d892", "name": "given name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${givenName}", "config": { "userinfo.token.claim": "true", "user.attribute": "firstName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "given_name", "jsonType.label": "String" } } ], "useTemplateConfig": false, "useTemplateScope": false, "useTemplateMappers": false }, { "id": "d73e211c-f7b9-4c8e-bc2f-9fc2044fdb3a", "clientId": "my-client", "name": "my-client", "description": "demo client to test android auth oauth code workflow", "rootUrl": "localhost", "adminUrl": "localhost", "surrogateAuthRequired": false, "enabled": true, "clientAuthenticatorType": "client-secret", "secret": "**", "redirectUris": [ "http://net.openid.appauthdemo:/oauth2redirect", "http://net.openid.appauthdemo:8080/", "localhost/", "http://net.openid.appauthdemo/*", "http://net.openid.appauthdemo", "http://net.openid.appauthdemo:8080/oauth2redirect" ], "webOrigins": [ "localhost" ], "notBefore": 0, "bearerOnly": false, "consentRequired": false, "standardFlowEnabled": true, "implicitFlowEnabled": false, "directAccessGrantsEnabled": true, "serviceAccountsEnabled": false, "publicClient": true, "frontchannelLogout": false, "protocol": "openid-connect", "attributes": { "saml.assertion.signature": "false", "saml.force.post.binding": "false", "saml.multivalued.roles": "false", "saml.encrypt": "false", "saml_force_name_id_format": "false", "saml.client.signature": "false", "saml.authnstatement": "false", "saml.server.signature": "false", "saml.server.signature.keyinfo.ext": "false", "exclude.session.state.from.auth.response": "false", "saml.onetimeuse.condition": "false" }, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": true, "nodeReRegistrationTimeout": -1, "protocolMappers": [ { "id": "d040f2b1-c59f-4706-a896-ec94c85a617e", "name": "role list", "protocol": "saml", "protocolMapper": "saml-role-list-mapper", "consentRequired": false, "config": { "single": "false", "attribute.nameformat": "Basic", "attribute.name": "Role" } }, { "id": "ef2f59e8-a626-4656-a539-83c8889091dc", "name": "username", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${username}", "config": { "userinfo.token.claim": "true", "user.attribute": "username", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "preferred_username", "jsonType.label": "String" } }, { "id": "39e11793-fbd8-4170-bf5a-ed8e704d95cc", "name": "given name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${givenName}", "config": { "userinfo.token.claim": "true", "user.attribute": "firstName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "given_name", "jsonType.label": "String" } }, { "id": "9f793e24-3cf6-48b1-be8e-8b8188fd6b57", "name": "full name", "protocol": "openid-connect", "protocolMapper": "oidc-full-name-mapper", "consentRequired": true, "consentText": "${fullName}", "config": { "id.token.claim": "true", "access.token.claim": "true" } }, { "id": "11e6c603-e3b1-4b52-badc-25c94b5fcc7c", "name": "email", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${email}", "config": { "userinfo.token.claim": "true", "user.attribute": "email", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "email", "jsonType.label": "String" } }, { "id": "96ef10d5-c926-4ddc-a95f-b97a2ad88ec5", "name": "family name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${familyName}", "config": { "userinfo.token.claim": "true", "user.attribute": "lastName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "family_name", "jsonType.label": "String" } } ], "useTemplateConfig": false, "useTemplateScope": false, "useTemplateMappers": false }, { "id": "c2dc7c9e-8ee5-4a0b-9910-c3b96f7eb891", "clientId": "security-admin-console", "name": "${client_security-admin-console}", "baseUrl": "/auth/admin/demo/console/index.html", "surrogateAuthRequired": false, "enabled": true, "clientAuthenticatorType": "client-secret", "secret": "**", "redirectUris": [ "/auth/admin/demo/console/*" ], "webOrigins": [], "notBefore": 0, "bearerOnly": false, "consentRequired": false, "standardFlowEnabled": true, "implicitFlowEnabled": false, "directAccessGrantsEnabled": false, "serviceAccountsEnabled": false, "publicClient": true, "frontchannelLogout": false, "protocol": "openid-connect", "attributes": {}, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, "protocolMappers": [ { "id": "57ccae09-f66c-4486-a36b-4e458f1ea1ec", "name": "locale", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-attribute-mapper", "consentRequired": false, "consentText": "${locale}", "config": { "userinfo.token.claim": "true", "user.attribute": "locale", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "locale", "jsonType.label": "String" } }, { "id": "a8756cbf-2da2-4e3e-b23b-bddd7eeb4273", "name": "role list", "protocol": "saml", "protocolMapper": "saml-role-list-mapper", "consentRequired": false, "config": { "single": "false", "attribute.nameformat": "Basic", "attribute.name": "Role" } }, { "id": "cddb815c-92b3-4022-93d7-988f38b8efcd", "name": "given name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${givenName}", "config": { "userinfo.token.claim": "true", "user.attribute": "firstName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "given_name", "jsonType.label": "String" } }, { "id": "9d48ddf2-1c8b-4f3f-b9ce-7cfb9bbf4255", "name": "full name", "protocol": "openid-connect", "protocolMapper": "oidc-full-name-mapper", "consentRequired": true, "consentText": "${fullName}", "config": { "id.token.claim": "true", "access.token.claim": "true" } }, { "id": "92ae66a9-528e-44a7-bcdb-fff435155361", "name": "family name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${familyName}", "config": { "userinfo.token.claim": "true", "user.attribute": "lastName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "family_name", "jsonType.label": "String" } }, { "id": "73f2042f-f439-443f-b2b7-cdb43d5df460", "name": "email", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${email}", "config": { "userinfo.token.claim": "true", "user.attribute": "email", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "email", "jsonType.label": "String" } }, { "id": "864022d0-6fc0-4803-993f-94e5c32b5d2f", "name": "username", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${username}", "config": { "userinfo.token.claim": "true", "user.attribute": "username", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "preferred_username", "jsonType.label": "String" } } ], "useTemplateConfig": false, "useTemplateScope": false, "useTemplateMappers": false }, { "id": "0f7629d0-7896-4408-ad9e-3948e3d424ee", "clientId": "account", "name": "${client_account}", "baseUrl": "/auth/realms/demo/account", "surrogateAuthRequired": false, "enabled": true, "clientAuthenticatorType": "client-secret", "secret": "**", "defaultRoles": [ "manage-account", "view-profile" ], "redirectUris": [ "/auth/realms/demo/account/*" ], "webOrigins": [], "notBefore": 0, "bearerOnly": false, "consentRequired": false, "standardFlowEnabled": true, "implicitFlowEnabled": false, "directAccessGrantsEnabled": false, "serviceAccountsEnabled": false, "publicClient": false, "frontchannelLogout": false, "protocol": "openid-connect", "attributes": {}, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, "protocolMappers": [ { "id": "842c49ae-852a-4700-8fca-0a34d408c668", "name": "username", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${username}", "config": { "userinfo.token.claim": "true", "user.attribute": "username", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "preferred_username", "jsonType.label": "String" } }, { "id": "1431429c-b1e6-48ab-a2e7-8dec1f714237", "name": "role list", "protocol": "saml", "protocolMapper": "saml-role-list-mapper", "consentRequired": false, "config": { "single": "false", "attribute.nameformat": "Basic", "attribute.name": "Role" } }, { "id": "84481919-efc3-42c1-b69b-d564f4090fa4", "name": "given name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${givenName}", "config": { "userinfo.token.claim": "true", "user.attribute": "firstName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "given_name", "jsonType.label": "String" } }, { "id": "2ba42c4d-d0e7-47d6-a5c9-67967a12a3c4", "name": "email", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${email}", "config": { "userinfo.token.claim": "true", "user.attribute": "email", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "email", "jsonType.label": "String" } }, { "id": "e8aea69c-290b-434c-b207-edd1cfac31f9", "name": "full name", "protocol": "openid-connect", "protocolMapper": "oidc-full-name-mapper", "consentRequired": true, "consentText": "${fullName}", "config": { "id.token.claim": "true", "access.token.claim": "true" } }, { "id": "77a7d44b-0532-435a-b8f6-4b36aa7bf6e5", "name": "family name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${familyName}", "config": { "userinfo.token.claim": "true", "user.attribute": "lastName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "family_name", "jsonType.label": "String" } } ], "useTemplateConfig": false, "useTemplateScope": false, "useTemplateMappers": false }, { "id": "dd8f0368-9f93-47fe-bab6-71d4ca331c9b", "clientId": "realm-management", "name": "${client_realm-management}", "surrogateAuthRequired": false, "enabled": true, "clientAuthenticatorType": "client-secret", "secret": "**", "redirectUris": [], "webOrigins": [], "notBefore": 0, "bearerOnly": true, "consentRequired": false, "standardFlowEnabled": true, "implicitFlowEnabled": false, "directAccessGrantsEnabled": false, "serviceAccountsEnabled": false, "publicClient": false, "frontchannelLogout": false, "protocol": "openid-connect", "attributes": {}, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, "protocolMappers": [ { "id": "8babda02-0922-4207-ad57-2471c80f32f7", "name": "family name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${familyName}", "config": { "userinfo.token.claim": "true", "user.attribute": "lastName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "family_name", "jsonType.label": "String" } }, { "id": "790b4bff-6a87-40d4-9597-4295af5e11b0", "name": "email", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${email}", "config": { "userinfo.token.claim": "true", "user.attribute": "email", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "email", "jsonType.label": "String" } }, { "id": "05dae298-988d-4064-8dec-a0f2faa4d4a1", "name": "role list", "protocol": "saml", "protocolMapper": "saml-role-list-mapper", "consentRequired": false, "config": { "single": "false", "attribute.nameformat": "Basic", "attribute.name": "Role" } }, { "id": "98291bc1-3c29-4277-b6a2-88b616c78fe2", "name": "username", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${username}", "config": { "userinfo.token.claim": "true", "user.attribute": "username", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "preferred_username", "jsonType.label": "String" } }, { "id": "f7b2c503-d01d-4eb4-a05b-a428c81e4332", "name": "given name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${givenName}", "config": { "userinfo.token.claim": "true", "user.attribute": "firstName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "given_name", "jsonType.label": "String" } }, { "id": "d83cc190-d2b0-4de9-b653-1e8a2cd1680a", "name": "full name", "protocol": "openid-connect", "protocolMapper": "oidc-full-name-mapper", "consentRequired": true, "consentText": "${fullName}", "config": { "id.token.claim": "true", "access.token.claim": "true" } } ], "useTemplateConfig": false, "useTemplateScope": false, "useTemplateMappers": false }, { "id": "0e53748b-d109-4980-b2d1-e162075c75d5", "clientId": "admin-cli", "name": "${client_admin-cli}", "surrogateAuthRequired": false, "enabled": true, "clientAuthenticatorType": "client-secret", "secret": "**", "redirectUris": [], "webOrigins": [], "notBefore": 0, "bearerOnly": false, "consentRequired": false, "standardFlowEnabled": false, "implicitFlowEnabled": false, "directAccessGrantsEnabled": true, "serviceAccountsEnabled": false, "publicClient": true, "frontchannelLogout": false, "protocol": "openid-connect", "attributes": {}, "authenticationFlowBindingOverrides": {}, "fullScopeAllowed": false, "nodeReRegistrationTimeout": 0, "protocolMappers": [ { "id": "06a15ff2-4cc6-49a8-ab2b-f1387489408f", "name": "email", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${email}", "config": { "userinfo.token.claim": "true", "user.attribute": "email", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "email", "jsonType.label": "String" } }, { "id": "ce0b51a1-0187-4f72-bf0f-f7cd524d2d88", "name": "given name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${givenName}", "config": { "userinfo.token.claim": "true", "user.attribute": "firstName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "given_name", "jsonType.label": "String" } }, { "id": "021f294a-f794-419a-98a8-2f56e1fbc47c", "name": "full name", "protocol": "openid-connect", "protocolMapper": "oidc-full-name-mapper", "consentRequired": true, "consentText": "${fullName}", "config": { "id.token.claim": "true", "access.token.claim": "true" } }, { "id": "13dc66b8-4593-401d-b1cf-b26bc7c2b40e", "name": "username", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${username}", "config": { "userinfo.token.claim": "true", "user.attribute": "username", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "preferred_username", "jsonType.label": "String" } }, { "id": "d335c311-076c-4807-992b-e408756df3c1", "name": "family name", "protocol": "openid-connect", "protocolMapper": "oidc-usermodel-property-mapper", "consentRequired": true, "consentText": "${familyName}", "config": { "userinfo.token.claim": "true", "user.attribute": "lastName", "id.token.claim": "true", "access.token.claim": "true", "claim.name": "family_name", "jsonType.label": "String" } }, { "id": "d4853cfd-ae35-4643-b9e5-50a038497387", "name": "role list", "protocol": "saml", "protocolMapper": "saml-role-list-mapper", "consentRequired": false, "config": { "single": "false", "attribute.nameformat": "Basic", "attribute.name": "Role" } } ], "useTemplateConfig": false, "useTemplateScope": false, "useTemplateMappers": false } ], "clientTemplates": [], "browserSecurityHeaders": { "xContentTypeOptions": "nosniff", "xRobotsTag": "none", "xFrameOptions": "SAMEORIGIN", "xXSSProtection": "1; mode=block", "contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", "strictTransportSecurity": "max-age=31536000; includeSubDomains" }, "smtpServer": {}, "eventsEnabled": false, "eventsListeners": [ "jboss-logging" ], "enabledEventTypes": [], "adminEventsEnabled": false, "adminEventsDetailsEnabled": false, "components": { "org.keycloak.services.clientregistration.policy.ClientRegistrationPolicy": [ { "id": "88f7bace-b81d-4b3e-8622-060c1d7408b5", "name": "Allowed Protocol Mapper Types", "providerId": "allowed-protocol-mappers", "subType": "anonymous", "subComponents": {}, "config": { "allowed-protocol-mapper-types": [ "saml-user-attribute-mapper", "oidc-usermodel-attribute-mapper", "oidc-address-mapper", "oidc-usermodel-property-mapper", "saml-user-property-mapper", "saml-role-list-mapper", "oidc-full-name-mapper", "oidc-sha256-pairwise-sub-mapper" ], "consent-required-for-all-mappers": [ "true" ] } }, { "id": "7b82779b-6409-4c49-9bfb-177621559515", "name": "Trusted Hosts", "providerId": "trusted-hosts", "subType": "anonymous", "subComponents": {}, "config": { "host-sending-registration-request-must-match": [ "true" ], "client-uris-must-match": [ "true" ] } }, { "id": "0ad56667-b57f-45d4-b64e-acba41db5dbf", "name": "Consent Required", "providerId": "consent-required", "subType": "anonymous", "subComponents": {}, "config": {} }, { "id": "3e47d396-4845-4020-afce-983def2a1ab6", "name": "Allowed Client Templates", "providerId": "allowed-client-templates", "subType": "authenticated", "subComponents": {}, "config": {} }, { "id": "e5a87b31-d2b9-43f1-b69b-a5404bc9f257", "name": "Allowed Protocol Mapper Types", "providerId": "allowed-protocol-mappers", "subType": "authenticated", "subComponents": {}, "config": { "allowed-protocol-mapper-types": [ "oidc-address-mapper", "oidc-sha256-pairwise-sub-mapper", "saml-user-attribute-mapper", "saml-user-property-mapper", "saml-role-list-mapper", "oidc-usermodel-property-mapper", "oidc-full-name-mapper", "oidc-usermodel-attribute-mapper" ], "consent-required-for-all-mappers": [ "true" ] } }, { "id": "955c4d12-9321-4db9-b41f-f223eb9f9e52", "name": "Max Clients Limit", "providerId": "max-clients", "subType": "anonymous", "subComponents": {}, "config": { "max-clients": [ "200" ] } }, { "id": "9c202a2b-ae59-4783-9f79-57ae346d57d7", "name": "Allowed Client Templates", "providerId": "allowed-client-templates", "subType": "anonymous", "subComponents": {}, "config": {} }, { "id": "b001a6ee-02a4-4d5a-9881-73a106ad4a6d", "name": "Full Scope Disabled", "providerId": "scope", "subType": "anonymous", "subComponents": {}, "config": {} } ], "org.keycloak.keys.KeyProvider": [ { "id": "9fb269d2-079b-44c2-bf51-b77a5421b0a6", "name": "rsa-generated", "providerId": "rsa-generated", "subComponents": {}, "config": { "priority": [ "100" ] } }, { "id": "24d5c9fe-9775-4d0d-9a00-ad6de2d03823", "name": "aes-generated", "providerId": "aes-generated", "subComponents": {}, "config": { "priority": [ "100" ] } }, { "id": "d276b4e6-8c47-400d-9dda-3b82739fb600", "name": "hmac-generated", "providerId": "hmac-generated", "subComponents": {}, "config": { "priority": [ "100" ] } } ] }, "internationalizationEnabled": false, "supportedLocales": [], "authenticationFlows": [ { "id": "c501a56b-34f6-499d-b05f-7a832a40999f", "alias": "Handle Existing Account", "description": "Handle what to do if there is existing account with same email/username like authenticated identity provider", "providerId": "basic-flow", "topLevel": false, "builtIn": true, "authenticationExecutions": [ { "authenticator": "idp-confirm-link", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "idp-email-verification", "requirement": "ALTERNATIVE", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false }, { "requirement": "ALTERNATIVE", "priority": 30, "flowAlias": "Verify Existing Account by Re-authentication", "userSetupAllowed": false, "autheticatorFlow": true } ] }, { "id": "c0946693-f89b-4545-95ec-bc9dca59a971", "alias": "Verify Existing Account by Re-authentication", "description": "Reauthentication of existing account", "providerId": "basic-flow", "topLevel": false, "builtIn": true, "authenticationExecutions": [ { "authenticator": "idp-username-password-form", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "auth-otp-form", "requirement": "OPTIONAL", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false } ] }, { "id": "3c4af680-6bd7-4c76-805a-fd4054b9d1ee", "alias": "browser", "description": "browser based authentication", "providerId": "basic-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticator": "auth-cookie", "requirement": "ALTERNATIVE", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "auth-spnego", "requirement": "DISABLED", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "identity-provider-redirector", "requirement": "ALTERNATIVE", "priority": 25, "userSetupAllowed": false, "autheticatorFlow": false }, { "requirement": "ALTERNATIVE", "priority": 30, "flowAlias": "forms", "userSetupAllowed": false, "autheticatorFlow": true } ] }, { "id": "fb23b30c-c0c3-4911-bb5e-60a3c9147d10", "alias": "clients", "description": "Base authentication for clients", "providerId": "client-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticator": "client-secret", "requirement": "ALTERNATIVE", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "client-jwt", "requirement": "ALTERNATIVE", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "client-secret-jwt", "requirement": "ALTERNATIVE", "priority": 30, "userSetupAllowed": false, "autheticatorFlow": false } ] }, { "id": "867fe311-b85d-44c7-8401-cc57314704f9", "alias": "direct grant", "description": "OpenID Connect Resource Owner Grant", "providerId": "basic-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticator": "direct-grant-validate-username", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "direct-grant-validate-password", "requirement": "REQUIRED", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "direct-grant-validate-otp", "requirement": "OPTIONAL", "priority": 30, "userSetupAllowed": false, "autheticatorFlow": false } ] }, { "id": "a040763c-3294-41c4-a3c1-bf9eb76c9ef3", "alias": "docker auth", "description": "Used by Docker clients to authenticate against the IDP", "providerId": "basic-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticator": "docker-http-basic-authenticator", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false } ] }, { "id": "8af48b6b-7ce9-4af1-a3cc-428b4cedeb15", "alias": "first broker login", "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", "providerId": "basic-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticatorConfig": "review profile config", "authenticator": "idp-review-profile", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticatorConfig": "create unique user config", "authenticator": "idp-create-user-if-unique", "requirement": "ALTERNATIVE", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false }, { "requirement": "ALTERNATIVE", "priority": 30, "flowAlias": "Handle Existing Account", "userSetupAllowed": false, "autheticatorFlow": true } ] }, { "id": "1b7402d2-5fbe-4c03-a0b5-4ef284706363", "alias": "forms", "description": "Username, password, otp and other auth forms.", "providerId": "basic-flow", "topLevel": false, "builtIn": true, "authenticationExecutions": [ { "authenticator": "auth-username-password-form", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "auth-otp-form", "requirement": "OPTIONAL", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false } ] }, { "id": "57e432f7-8d97-4228-a3c6-20f1933fdb23", "alias": "registration", "description": "registration flow", "providerId": "basic-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticator": "registration-page-form", "requirement": "REQUIRED", "priority": 10, "flowAlias": "registration form", "userSetupAllowed": false, "autheticatorFlow": true } ] }, { "id": "170d4403-3a34-4f12-a3ab-ff44991aa48f", "alias": "registration form", "description": "registration form", "providerId": "form-flow", "topLevel": false, "builtIn": true, "authenticationExecutions": [ { "authenticator": "registration-user-creation", "requirement": "REQUIRED", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "registration-profile-action", "requirement": "REQUIRED", "priority": 40, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "registration-password-action", "requirement": "REQUIRED", "priority": 50, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "registration-recaptcha-action", "requirement": "DISABLED", "priority": 60, "userSetupAllowed": false, "autheticatorFlow": false } ] }, { "id": "406e50f1-1fcc-4fe7-8a15-7b9e207adbee", "alias": "reset credentials", "description": "Reset credentials for a user if they forgot their password or something", "providerId": "basic-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticator": "reset-credentials-choose-user", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "reset-credential-email", "requirement": "REQUIRED", "priority": 20, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "reset-password", "requirement": "REQUIRED", "priority": 30, "userSetupAllowed": false, "autheticatorFlow": false }, { "authenticator": "reset-otp", "requirement": "OPTIONAL", "priority": 40, "userSetupAllowed": false, "autheticatorFlow": false } ] }, { "id": "be6c7ee4-2d18-48e7-a338-d0e36649ebe3", "alias": "saml ecp", "description": "SAML ECP Profile Authentication Flow", "providerId": "basic-flow", "topLevel": true, "builtIn": true, "authenticationExecutions": [ { "authenticator": "http-basic-authenticator", "requirement": "REQUIRED", "priority": 10, "userSetupAllowed": false, "autheticatorFlow": false } ] } ], "authenticatorConfig": [ { "id": "4ac1ce60-d7b2-4b5b-90f6-19d3d1448055", "alias": "create unique user config", "config": { "require.password.update.after.registration": "false" } }, { "id": "9746775e-a739-4c7f-a531-94f0b1f9a441", "alias": "review profile config", "config": { "update.profile.on.first.login": "missing" } } ], "requiredActions": [ { "alias": "CONFIGURE_TOTP", "name": "Configure OTP", "providerId": "CONFIGURE_TOTP", "enabled": true, "defaultAction": false, "config": {} }, { "alias": "UPDATE_PASSWORD", "name": "Update Password", "providerId": "UPDATE_PASSWORD", "enabled": true, "defaultAction": false, "config": {} }, { "alias": "UPDATE_PROFILE", "name": "Update Profile", "providerId": "UPDATE_PROFILE", "enabled": true, "defaultAction": false, "config": {} }, { "alias": "VERIFY_EMAIL", "name": "Verify Email", "providerId": "VERIFY_EMAIL", "enabled": true, "defaultAction": false, "config": {} }, { "alias": "terms_and_conditions", "name": "Terms and Conditions", "providerId": "terms_and_conditions", "enabled": false, "defaultAction": false, "config": {} } ], "browserFlow": "browser", "registrationFlow": "registration", "directGrantFlow": "direct grant", "resetCredentialsFlow": "reset credentials", "clientAuthenticationFlow": "clients", "dockerAuthenticationFlow": "docker auth", "attributes": { "_browser_header.xXSSProtection": "1; mode=block", "_browser_header.strictTransportSecurity": "max-age=31536000; includeSubDomains", "_browser_header.xFrameOptions": "SAMEORIGIN", "permanentLockout": "false", "quickLoginCheckMilliSeconds": "1000", "_browser_header.xRobotsTag": "none", "maxFailureWaitSeconds": "900", "minimumQuickLoginWaitSeconds": "60", "failureFactor": "30", "actionTokenGeneratedByUserLifespan": "300", "maxDeltaTimeSeconds": "43200", "_browser_header.xContentTypeOptions": "nosniff", "actionTokenGeneratedByAdminLifespan": "43200", "bruteForceProtected": "false", "_browser_header.contentSecurityPolicy": "frame-src 'self'; frame-ancestors 'self'; object-src 'none';", "waitIncrementSeconds": "60" }, "keycloakVersion": "4.0.0.Beta1", "userManagedAccessAllowed": false }