p2-inc / keycloak-magic-link

Magic Link Authentication for Keycloak
Other
217 stars 43 forks source link

Installation not working #48

Closed hrueger closed 10 months ago

hrueger commented 10 months ago

Hi, first of all, thanks for this plugin. I'd really like to use it, however, I cannot get it installed (or enabled?). I'm using the bitnami keycloak docker image. My docker-compose.yml looks like this:

version: '3.3'
services:
  postgresql:
    restart: unless-stopped
    image: bitnami/postgresql
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
      - POSTGRESQL_USERNAME=bn_keycloak
      - POSTGRESQL_DATABASE=bitnami_keycloak
    volumes:
      - 'postgresql_data:/bitnami/postgresql'

  keycloak:
    restart: unless-stopped
    image: bitnami/keycloak
    # enable token-exchange
    environment:
      - KEYCLOAK_EXTRA_ARGS=--features=token-exchange,admin-fine-grained-authz
    # extension jars from ./keycloak-extensions (new for quarkus)
    volumes:
      - ./keycloak-extensions:/opt/bitnami/keycloak/providers
    depends_on:
      - postgresql
    ports:
      - '8081:8080'

volumes:
  postgresql_data:
    driver: local

I've copied the keycloak-magic-link-0.17-SNAPSHOT.jar to ./keycloak-extensions.

However, the /magic-link url returns a {"error":"HTTP 404 Not Found"} and I can't find the Magic Link Step in the UI. I made sure to not be on the master realm.

Keycloak does somehow detect the .jar file, because if I copy both by mvn clean install generated files (keycloak-magic-link-0.17-SNAPSHOT.jar and original-keycloak-magic-link-0.17-SNAPSHOT.jar, the docker logs show:

2023-08-22 10:52:33 2023-08-22 08:52:32,131 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: admin-fine-grained-authz, token-exchange
2023-08-22 10:52:33 2023-08-22 08:52:33,369 WARN  [io.quarkus.arc.deployment.SplitPackageProcessor] (build-2) Detected a split package usage which is considered a bad practice and should be avoided. Following packages were detected in multiple archives: 
2023-08-22 10:52:33 - "io.phasetwo.keycloak.magic.auth.token" found in [/opt/bitnami/keycloak/lib/../providers/keycloak-magic-link-0.17-SNAPSHOT.jar, /opt/bitnami/keycloak/lib/../providers/original-keycloak-magic-link-0.17-SNAPSHOT.jar]
2023-08-22 10:52:33 - "io.phasetwo.keycloak.magic" found in [/opt/bitnami/keycloak/lib/../providers/keycloak-magic-link-0.17-SNAPSHOT.jar, /opt/bitnami/keycloak/lib/../providers/original-keycloak-magic-link-0.17-SNAPSHOT.jar]
2023-08-22 10:52:33 - "io.phasetwo.keycloak.magic.auth" found in [/opt/bitnami/keycloak/lib/../providers/keycloak-magic-link-0.17-SNAPSHOT.jar, /opt/bitnami/keycloak/lib/../providers/original-keycloak-magic-link-0.17-SNAPSHOT.jar]
2023-08-22 10:52:33 - "io.phasetwo.keycloak.magic.representation" found in [/opt/bitnami/keycloak/lib/../providers/keycloak-magic-link-0.17-SNAPSHOT.jar, /opt/bitnami/keycloak/lib/../providers/original-keycloak-magic-link-0.17-SNAPSHOT.jar]
2023-08-22 10:52:33 - "io.phasetwo.keycloak.magic.resources" found in [/opt/bitnami/keycloak/lib/../providers/keycloak-magic-link-0.17-SNAPSHOT.jar, /opt/bitnami/keycloak/lib/../providers/original-keycloak-magic-link-0.17-SNAPSHOT.jar]
2023-08-22 10:52:35 2023-08-22 08:52:35,695 INFO  [io.quarkus.deployment.QuarkusAugmentor] (main) Quarkus augmentation completed in 3975ms

Docker Container logs with only one of the two files (which one should be used by the way?)

2023-08-22 10:46:20 
2023-08-22 10:46:20 keycloak 08:46:20.79 
2023-08-22 10:46:20 keycloak 08:46:20.79 Welcome to the Bitnami keycloak container
2023-08-22 10:46:20 keycloak 08:46:20.79 Subscribe to project updates by watching https://github.com/bitnami/containers
2023-08-22 10:46:20 keycloak 08:46:20.80 Submit issues and feature requests at https://github.com/bitnami/containers/issues
2023-08-22 10:46:20 keycloak 08:46:20.80 
2023-08-22 10:46:20 keycloak 08:46:20.80 INFO  ==> ** Starting keycloak setup **
2023-08-22 10:46:20 keycloak 08:46:20.81 INFO  ==> Validating settings in KEYCLOAK_* env vars...
2023-08-22 10:46:20 /opt/bitnami/scripts/libvalidations.sh: line 245: return: : numeric argument required
2023-08-22 10:46:20 keycloak 08:46:20.82 INFO  ==> Trying to connect to PostgreSQL server postgresql...
2023-08-22 10:46:20 keycloak 08:46:20.83 INFO  ==> Found PostgreSQL server listening at postgresql:5432
2023-08-22 10:46:20 keycloak 08:46:20.84 INFO  ==> Configuring database settings
2023-08-22 10:46:20 keycloak 08:46:20.86 INFO  ==> Enabling statistics
2023-08-22 10:46:20 keycloak 08:46:20.87 INFO  ==> Enabling health endpoints
2023-08-22 10:46:20 keycloak 08:46:20.87 INFO  ==> Configuring http settings
2023-08-22 10:46:20 keycloak 08:46:20.90 INFO  ==> Configuring hostname settings
2023-08-22 10:46:20 keycloak 08:46:20.90 INFO  ==> Configuring cache count
2023-08-22 10:46:20 keycloak 08:46:20.91 INFO  ==> Configuring log level
2023-08-22 10:46:20 keycloak 08:46:20.91 INFO  ==> Configuring proxy
2023-08-22 10:46:20 keycloak 08:46:20.92 INFO  ==> ** keycloak setup finished! **
2023-08-22 10:46:20 keycloak 08:46:20.93 INFO  ==> ** Starting keycloak **
2023-08-22 10:46:21 Updating the configuration and installing your custom providers, if any. Please wait.
2023-08-22 10:46:24 2023-08-22 08:46:21,563 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: admin-fine-grained-authz, token-exchange
2023-08-22 10:46:24 2023-08-22 08:46:23,076 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: admin-fine-grained-authz, token-exchange
2023-08-22 10:46:27 2023-08-22 08:46:27,068 INFO  [io.quarkus.deployment.QuarkusAugmentor] (main) Quarkus augmentation completed in 4387ms
2023-08-22 10:46:29 2023-08-22 08:46:27,836 INFO  [org.keycloak.common.Profile] (main) Preview features enabled: admin-fine-grained-authz, token-exchange
2023-08-22 10:46:29 2023-08-22 08:46:28,258 INFO  [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: Base URL: <unset>, Hostname: <request>, Strict HTTPS: false, Path: <request>, Strict BackChannel: false, Admin URL: <unset>, Admin: <request>, Port: -1, Proxied: true
2023-08-22 10:46:29 2023-08-22 08:46:29,711 WARN  [io.quarkus.agroal.runtime.DataSources] (main) Datasource <default> enables XA but transaction recovery is not enabled. Please enable transaction recovery by setting quarkus.transaction-manager.enable-recovery=true, otherwise data may be lost if the application is terminated abruptly
2023-08-22 10:46:30 2023-08-22 08:46:30,357 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
2023-08-22 10:46:30 2023-08-22 08:46:30,453 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
2023-08-22 10:46:30 2023-08-22 08:46:30,568 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!
2023-08-22 10:46:30 2023-08-22 08:46:30,656 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000078: Starting JGroups channel `ISPN`
2023-08-22 10:46:30 2023-08-22 08:46:30,658 INFO  [org.jgroups.JChannel] (keycloak-cache-init) local_addr: 726a0f81-c6b5-42ba-8642-0d0913d3ff28, name: 2c353f136ffd-12467
2023-08-22 10:46:30 2023-08-22 08:46:30,664 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the send buffer of socket MulticastSocket was set to 1MB, but the OS only allocated 212.99KB
2023-08-22 10:46:30 2023-08-22 08:46:30,665 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the receive buffer of socket MulticastSocket was set to 20MB, but the OS only allocated 212.99KB
2023-08-22 10:46:30 2023-08-22 08:46:30,665 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the send buffer of socket MulticastSocket was set to 1MB, but the OS only allocated 212.99KB
2023-08-22 10:46:30 2023-08-22 08:46:30,665 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the receive buffer of socket MulticastSocket was set to 25MB, but the OS only allocated 212.99KB
2023-08-22 10:46:30 2023-08-22 08:46:30,674 INFO  [org.jgroups.protocols.FD_SOCK2] (keycloak-cache-init) server listening on *.27504
2023-08-22 10:46:30 2023-08-22 08:46:30,967 INFO  [org.keycloak.broker.provider.AbstractIdentityProviderMapper] (main) Registering class org.keycloak.broker.provider.mappersync.ConfigSyncEventListener
2023-08-22 10:46:32 2023-08-22 08:46:32,682 INFO  [org.jgroups.protocols.pbcast.GMS] (keycloak-cache-init) 2c353f136ffd-12467: no members discovered after 2006 ms: creating cluster as coordinator
2023-08-22 10:46:32 2023-08-22 08:46:32,689 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000094: Received new cluster view for channel ISPN: [2c353f136ffd-12467|0] (1) [2c353f136ffd-12467]
2023-08-22 10:46:32 2023-08-22 08:46:32,699 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000079: Channel `ISPN` local address is `2c353f136ffd-12467`, physical addresses are `[172.20.0.6:43040]`
2023-08-22 10:46:33 2023-08-22 08:46:33,030 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: 2c353f136ffd-12467, Site name: null
2023-08-22 10:46:33 2023-08-22 08:46:33,829 INFO  [io.quarkus] (main) Keycloak 22.0.1 on JVM (powered by Quarkus 3.2.0.Final) started in 6.663s. Listening on: http://0.0.0.0:8080
2023-08-22 10:46:33 2023-08-22 08:46:33,830 INFO  [io.quarkus] (main) Profile dev activated. 
2023-08-22 10:46:33 2023-08-22 08:46:33,830 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle, jdbc-postgresql, keycloak, logging-gelf, micrometer, narayana-jta, reactive-routes, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-health, vertx]
2023-08-22 10:46:33 2023-08-22 08:46:33,837 WARN  [org.keycloak.quarkus.runtime.KeycloakMain] (main) Running the server in development mode. DO NOT use this configuration in production.

Any idea what I might be missing?

xgp commented 10 months ago

You only need the keycloak-magic-link-0.17-SNAPSHOT.jar. I'm not familiar with the bitnami image, but putting it in the providers directory sounds right. After a successful install, the endpoint should be at https://{keycloak-host}/{relative-path}/realms/{realm}/magic-link, and there should be an example flow called "Magic Link" available in your Authentication Flows.

hrueger commented 10 months ago

Hi, thanks for the quick answer. Yes I tried that url (I'm not using a custom relative path and I'm on the keycloak 22, so no /auth prefix). I also can't find the example flow nor the execution step step in the ui... Do you think it is an issue with the image?

I believe the providers directory is correct since it complains if there are two .jar files.

xgp commented 10 months ago

I did a quick test with this docker-compose file and it works fine:

version: '3'

services:
  keycloak:
    image: docker.io/bitnami/keycloak:22.0.1
    volumes:
      - ${PWD}/target/keycloak-magic-link-0.17-SNAPSHOT.jar:/opt/bitnami/keycloak/providers/keycloak-magic-link.jar
    environment:
      KEYCLOAK_DATABASE_VENDOR: dev-mem
      KEYCLOAK_ADMIN: admin
      KEYCLOAK_ADMIN_PASSWORD: admin
    ports:
      - 8080:8080

and I see the following on start

2023-08-22 10:03:50,785 WARN  [org.keycloak.services] (build-41) KC-SERVICES0047: magic-link (io.phasetwo.keycloak.magic.resources.MagicLinkResourceProviderFactory) is implementing the internal SPI realm-restapi-extension. This SPI is internal and may change without notice
2023-08-22 10:03:50,866 WARN  [org.keycloak.services] (build-41) KC-SERVICES0047: ext-magic-form (io.phasetwo.keycloak.magic.auth.MagicLinkAuthenticatorFactory) is implementing the internal SPI authenticator. This SPI is internal and may change without notice
2023-08-22 10:03:50,866 WARN  [org.keycloak.services] (build-41) KC-SERVICES0047: ext-email-otp (io.phasetwo.keycloak.magic.auth.EmailOtpAuthenticatorFactory) is implementing the internal SPI authenticator. This SPI is internal and may change without notice
2023-08-22 10:03:51,034 WARN  [org.keycloak.services] (build-41) KC-SERVICES0047: ext-magic-link (io.phasetwo.keycloak.magic.auth.token.MagicLinkActionTokenHandlerFactory) is implementing the internal SPI actionTokenHandler. This SPI is internal and may change without notice

and

2023-08-22 10:04:04,998 INFO  [io.phasetwo.keycloak.magic.MagicLink] (main) creating built-in auth flow for magic link
hrueger commented 10 months ago

I'm sorry, but I still can't get it to work. I believe I'm doing the exact same thing: https://github.com/hrueger/keycloak-magic-link-installation-issue I run docker compose up -d and get those container logs:

2023-08-22 13:31:04 keycloak 11:31:04.85 
2023-08-22 13:31:04 keycloak 11:31:04.85 Welcome to the Bitnami keycloak container
2023-08-22 13:31:04 keycloak 11:31:04.85 Subscribe to project updates by watching https://github.com/bitnami/containers
2023-08-22 13:31:04 keycloak 11:31:04.86 Submit issues and feature requests at https://github.com/bitnami/containers/issues
2023-08-22 13:31:04 keycloak 11:31:04.86 
2023-08-22 13:31:04 keycloak 11:31:04.86 INFO  ==> ** Starting keycloak setup **
2023-08-22 13:31:04 keycloak 11:31:04.87 INFO  ==> Validating settings in KEYCLOAK_* env vars...
2023-08-22 13:31:04 /opt/bitnami/scripts/libvalidations.sh: line 245: return: : numeric argument required
2023-08-22 13:31:04 keycloak 11:31:04.88 INFO  ==> Configuring database settings
2023-08-22 13:31:04 keycloak 11:31:04.89 INFO  ==> Enabling statistics
2023-08-22 13:31:04 keycloak 11:31:04.89 INFO  ==> Enabling health endpoints
2023-08-22 13:31:04 keycloak 11:31:04.89 INFO  ==> Configuring http settings
2023-08-22 13:31:04 keycloak 11:31:04.91 INFO  ==> Configuring hostname settings
2023-08-22 13:31:04 keycloak 11:31:04.91 INFO  ==> Configuring cache count
2023-08-22 13:31:04 keycloak 11:31:04.92 INFO  ==> Configuring log level
2023-08-22 13:31:04 keycloak 11:31:04.92 INFO  ==> Configuring proxy
2023-08-22 13:31:04 keycloak 11:31:04.93 INFO  ==> ** keycloak setup finished! **
2023-08-22 13:31:04 keycloak 11:31:04.94 INFO  ==> ** Starting keycloak **
2023-08-22 13:31:04 
2023-08-22 13:31:05 Updating the configuration and installing your custom providers, if any. Please wait.
2023-08-22 13:31:08 2023-08-22 11:31:07,987 WARN  [org.keycloak.services] (build-28) KC-SERVICES0047: metrics (org.jboss.aerogear.keycloak.metrics.MetricsEndpointFactory) is implementing the internal SPI realm-restapi-extension. This SPI is internal and may change without notice
2023-08-22 13:31:08 2023-08-22 11:31:08,279 WARN  [org.keycloak.services] (build-28) KC-SERVICES0047: metrics-listener (org.jboss.aerogear.keycloak.metrics.MetricsEventListenerFactory) is implementing the internal SPI eventsListener. This SPI is internal and may change without notice
2023-08-22 13:31:12 2023-08-22 11:31:12,614 INFO  [io.quarkus.deployment.QuarkusAugmentor] (main) Quarkus augmentation completed in 5895ms
2023-08-22 13:31:14 2023-08-22 11:31:13,657 INFO  [org.keycloak.quarkus.runtime.hostname.DefaultHostnameProvider] (main) Hostname settings: Base URL: <unset>, Hostname: <request>, Strict HTTPS: false, Path: <request>, Strict BackChannel: false, Admin URL: <unset>, Admin: <request>, Port: -1, Proxied: true
2023-08-22 13:31:14 2023-08-22 11:31:14,904 WARN  [io.quarkus.agroal.runtime.DataSources] (main) Datasource <default> enables XA but transaction recovery is not enabled. Please enable transaction recovery by setting quarkus.transaction-manager.enable-recovery=true, otherwise data may be lost if the application is terminated abruptly
2023-08-22 13:31:15 2023-08-22 11:31:15,531 WARN  [org.infinispan.PERSISTENCE] (keycloak-cache-init) ISPN000554: jboss-marshalling is deprecated and planned for removal
2023-08-22 13:31:15 2023-08-22 11:31:15,616 INFO  [org.infinispan.CONTAINER] (keycloak-cache-init) ISPN000556: Starting user marshaller 'org.infinispan.jboss.marshalling.core.JBossUserMarshaller'
2023-08-22 13:31:15 2023-08-22 11:31:15,729 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000088: Unable to use any JGroups configuration mechanisms provided in properties {}. Using default JGroups configuration!
2023-08-22 13:31:15 2023-08-22 11:31:15,811 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000078: Starting JGroups channel `ISPN`
2023-08-22 13:31:15 2023-08-22 11:31:15,813 INFO  [org.jgroups.JChannel] (keycloak-cache-init) local_addr: 01ebc1b6-8502-450b-b177-aee676ed80db, name: 9cbd0a9bec25-38310
2023-08-22 13:31:15 2023-08-22 11:31:15,822 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the send buffer of socket MulticastSocket was set to 1MB, but the OS only allocated 212.99KB
2023-08-22 13:31:15 2023-08-22 11:31:15,822 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the receive buffer of socket MulticastSocket was set to 20MB, but the OS only allocated 212.99KB
2023-08-22 13:31:15 2023-08-22 11:31:15,823 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the send buffer of socket MulticastSocket was set to 1MB, but the OS only allocated 212.99KB
2023-08-22 13:31:15 2023-08-22 11:31:15,823 WARN  [org.jgroups.protocols.UDP] (keycloak-cache-init) JGRP000015: the receive buffer of socket MulticastSocket was set to 25MB, but the OS only allocated 212.99KB
2023-08-22 13:31:15 2023-08-22 11:31:15,839 INFO  [org.jgroups.protocols.FD_SOCK2] (keycloak-cache-init) server listening on *.39776
2023-08-22 13:31:15 2023-08-22 11:31:15,879 INFO  [org.keycloak.broker.provider.AbstractIdentityProviderMapper] (main) Registering class org.keycloak.broker.provider.mappersync.ConfigSyncEventListener
2023-08-22 13:31:16 2023-08-22 11:31:16,836 INFO  [org.keycloak.quarkus.runtime.storage.legacy.liquibase.QuarkusJpaUpdaterProvider] (main) Initializing database schema. Using changelog META-INF/jpa-changelog-master.xml
2023-08-22 13:31:17 2023-08-22 11:31:17,844 INFO  [org.jgroups.protocols.pbcast.GMS] (keycloak-cache-init) 9cbd0a9bec25-38310: no members discovered after 2002 ms: creating cluster as coordinator
2023-08-22 13:31:17 2023-08-22 11:31:17,851 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000094: Received new cluster view for channel ISPN: [9cbd0a9bec25-38310|0] (1) [9cbd0a9bec25-38310]
2023-08-22 13:31:17 2023-08-22 11:31:17,865 INFO  [org.infinispan.CLUSTER] (keycloak-cache-init) ISPN000079: Channel `ISPN` local address is `9cbd0a9bec25-38310`, physical addresses are `[172.23.0.2:55312]`
2023-08-22 13:31:18 2023-08-22 11:31:18,549 INFO  [org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory] (main) Node name: 9cbd0a9bec25-38310, Site name: null
2023-08-22 13:31:18 2023-08-22 11:31:18,683 INFO  [org.keycloak.services] (main) KC-SERVICES0050: Initializing master realm
2023-08-22 13:31:20 2023-08-22 11:31:20,110 INFO  [io.quarkus] (main) Keycloak 22.0.1 on JVM (powered by Quarkus 3.2.0.Final) started in 7.409s. Listening on: http://0.0.0.0:8080
2023-08-22 13:31:20 2023-08-22 11:31:20,110 INFO  [io.quarkus] (main) Profile dev activated. 
2023-08-22 13:31:20 2023-08-22 11:31:20,110 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, jdbc-h2, jdbc-mariadb, jdbc-mssql, jdbc-mysql, jdbc-oracle, jdbc-postgresql, keycloak, logging-gelf, micrometer, narayana-jta, reactive-routes, resteasy, resteasy-jackson, smallrye-context-propagation, smallrye-health, vertx]
2023-08-22 13:31:20 2023-08-22 11:31:20,251 INFO  [org.keycloak.services] (main) KC-SERVICES0009: Added user 'admin' to realm 'master'
2023-08-22 13:31:20 2023-08-22 11:31:20,253 WARN  [org.keycloak.quarkus.runtime.KeycloakMain] (main) Running the server in development mode. DO NOT use this configuration in production.

No mentioning of magic-link or similar. I can't see it in the ui either. Maybe my .jar file is just broken?

The only things I changed are ${PWD}/ to ./ since I'm on windows, and the port from 8080 to 8089.

hrueger commented 10 months ago

I found it: somehow the generated .jar file was broken.

I used GitHub Codespaces and (please don't ask me why) the first time it built and generated files with ca. 39 kb, the second time I build, I got about 47 kb.

But never mind, now its working 👍 Sorry for the noise.

xgp commented 10 months ago

It's not the first time I've heard of something going sideways in Codespaces. Thanks for chasing down the root cause and sharing your findings. Let me know if anything else comes up as you use our extension.

hrueger commented 10 months ago

Yes, there are actually some minor things (let me know if you want a new issue for that):

  1. I have Duplicate emails enabled in Keycloak. Therefore, I can't use email as the values are not unique. I was first looking to specify the user via its id, but I only found the username option in your rest api endpoint. This works fine, though.
  2. I was not able to disable the update_password required action, since it is automatically enabled when specifying the username. What is the reason for that? I changed that in a fork for my usecase: https://github.com/p2-inc/keycloak-magic-link/commit/f6712c8cef1be633b428dbb25948e5e98341fd63
  3. When specifying a non-existing username, I get the following error: User with email null not found, and forceCreate is off. This was a bit confusing, since I thought it did not take my username field.

However, those are only minor things and I was able to work around them pretty easily. Other than that its working just fine!

xgp commented 10 months ago

2 seems like a bug. I can't remember a reason for forcing update_password (or update_profile for that matter). I'll update that.

hrueger commented 10 months ago

Cool, thanks!

hrueger commented 10 months ago

(Just on my phone, so I can't comment on the commit) I saw that you also changed the error message I mentioned. Love that. I think it would make sense to show the username at %s if no email is given? Currently, getEmail is hardcoded there and it might confuse people cause they think their argument value didn't make it into username properly. Does that make sense?

xgp commented 10 months ago

You're right. It should probably be emailOrUsername