lvermeulen / Keycloak.Net

C# client for Keycloak 6.x
MIT License
206 stars 121 forks source link

provide SmtpServer payload, fix content-type of VerifyUserEmailAddress… #44

Closed manuscrypt closed 3 years ago

manuscrypt commented 3 years ago

…Async

psavva commented 3 years ago

I can confirm this exact same bug, I have just come across it now, developing against this library. Please review, and commit the fix.

psavva commented 3 years ago

@lvermeulen Any chance to review and have this part of the next release?

psavva commented 3 years ago

@lvermeulen I hope you are keeping well? Could you provide an update on merging this PR?

Best Regards Panayiotis Savva

lvermeulen commented 3 years ago

Thanks @manuscrypt !

psavva commented 2 years ago

@manuscrypt @lvermeulen I have used the latest version of the application, and am still hitting 400 HTTP error upon calling the function.

Have you managed to make this work? Is there anything special we need to consider?

psavva commented 2 years ago

Exception: {"Call failed with status code 415 (Unsupported Media Type): PUT https://auth.ehealth4u.eu/auth/admin/realms/ehealth4u/users/295c4b83-9e83-4462-be78-0741a97a3af5/send-verify-email"}

Stack Trace:

   at Flurl.Http.FlurlRequest.<HandleExceptionAsync>d__23.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Flurl.Http.FlurlRequest.<SendAsync>d__19.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Flurl.Http.FlurlRequest.<SendAsync>d__19.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Keycloak.Net.KeycloakClient.<VerifyUserEmailAddressAsync>d__312.MoveNext()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Client.IdP.Keycloak.ClientKeycloak.<EmailVerification>d__10.MoveNext() in C:\repos\UCY\eHealth4u\eHealth4U.EHR.Backend\src\Client.IdP.Keycloak\ClientKeycloak.cs:line 237
manuscrypt commented 2 years ago

@manuscrypt @lvermeulen I have used the latest version of the application, and am still hitting 400 HTTP error upon calling the function.

Have you managed to make this work? Is there anything special we need to consider?

Sorry, nothing special comes to mind. Can you get it working using postman (or the like)? We are using jboss/keycloak:12.0.4

                {
                    "name": "Send Verify Email",
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "exec": [
                                    ""
                                ],
                                "type": "text/javascript"
                            }
                        }
                    ],
                    "request": {
                        "auth": {
                            "type": "bearer",
                            "bearer": [
                                {
                                    "key": "token",
                                    "value": "{{token}}",
                                    "type": "string"
                                }
                            ]
                        },
                        "method": "PUT",
                        "header": [],
                        "url": {
                            "raw": "{{keycloakApiHost}}/auth/admin/realms/{{realm}}/users/{{userId}}/send-verify-email?client_id=null&redirect_uri=null",
                            "host": [
                                "{{keycloakApiHost}}"
                            ],
                            "path": [
                                "auth",
                                "admin",
                                "realms",
                                "{{realm}}",
                                "users",
                                "{{userId}}",
                                "send-verify-email"
                            ],
                            "query": [
                                {
                                    "key": "client_id",
                                    "value": "null"
                                },
                                {
                                    "key": "redirect_uri",
                                    "value": "null"
                                }
                            ]
                        }
                    },
                    "response": []
                }