continuing-cyan
continuing-cyan•2y ago

Authentication with Strapi

I am not able to use Strapi authentication together with refine. My client connects normally with the API (I can access the collections when I disable the authProvider). When I try to use the authProvider, it returns a 400 error. Could someone help me? Grateful for the attention.
6 Replies
refine-support-bot
refine-support-bot•2y ago
Hey, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and could not find an answer. Please wait for someone from the refine core team or the community to try to help you. 👊
absent-sapphire
absent-sapphire•2y ago
Hey @Rodrigo Cândido, Did you check out our strapi example? You can find here: https://refine.dev/docs/examples/data-provider/strapi-v4/
continuing-cyan
continuing-cyan•2y ago
Hello @salihozdemir. I had already checked the strapi example and configured the API connection url. I imagine my problem is related to strapi's login permissions, but I don't know how to configure this to work with refine.
absent-sapphire
absent-sapphire•2y ago
You should set your resources’ permissions to ‘Auth’ instead of the ‘public’ in the Settings tab on your strapi admin panel. I don’t remember exacly how to set it up. You can find it in the strapi documantations.
continuing-cyan
continuing-cyan•2y ago
I just realized that when submitting the login form (generated by refine) the identifier (e-mail) is not being sent to the body of the request, only the password.
absent-sapphire
absent-sapphire•2y ago