You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find the latest implementation of the Identity Endpoints a really cool feature! It really speeds up the development for an application which requires authentication/authorization flows. However I found quite difficult to override the register endpoint in my case and I would like to ask for a way to make the endpoints easier to override. A guy made a simple solution which could be a good point into the right direction which is:
app.MapIdentityApiFilterable<User>(new IdentityApiEndpointRouteBuilderOptions() { ExcludeRegisterPost = true, ExcludeLoginPost = true, ExcludeRefreshPost = true, ExcludeConfirmEmailGet = true, ExcludeResendConfirmationEmailPost = true, ExcludeForgotPasswordPost = true, ExcludeResetPasswordPost = true, // setting ExcludeManageGroup to false will disable // 2FA and both Info Actions ExcludeManageGroup = true, Exclude2faPost = true, ExcludegInfoGet = true, ExcludeInfoPost = true, });
in this way I can "select" which default endpoints I want to expose and the ones I want to implement my version of, at the moment I took the code out of IdentityApiEndpointRouteBuilderExtensions.cs class (copy paste of the register endpoint section and edited as needed)
But it would easier (and cleaner) to have a way to implement some interface for each endpoint so that I just need to plugin my custom logic
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I find the latest implementation of the Identity Endpoints a really cool feature! It really speeds up the development for an application which requires authentication/authorization flows. However I found quite difficult to override the register endpoint in my case and I would like to ask for a way to make the endpoints easier to override. A guy made a simple solution which could be a good point into the right direction which is:
app.MapIdentityApiFilterable<User>(new IdentityApiEndpointRouteBuilderOptions() { ExcludeRegisterPost = true, ExcludeLoginPost = true, ExcludeRefreshPost = true, ExcludeConfirmEmailGet = true, ExcludeResendConfirmationEmailPost = true, ExcludeForgotPasswordPost = true, ExcludeResetPasswordPost = true, // setting ExcludeManageGroup to false will disable // 2FA and both Info Actions ExcludeManageGroup = true, Exclude2faPost = true, ExcludegInfoGet = true, ExcludeInfoPost = true, });
in this way I can "select" which default endpoints I want to expose and the ones I want to implement my version of, at the moment I took the code out of IdentityApiEndpointRouteBuilderExtensions.cs class (copy paste of the register endpoint section and edited as needed)
But it would easier (and cleaner) to have a way to implement some interface for each endpoint so that I just need to plugin my custom logic
https://github.com/darkosubic/EasyAuth/tree/master?tab=readme-ov-file
Beta Was this translation helpful? Give feedback.
All reactions