deep-jade
deep-jade10mo ago

LDAP Auth

Hi everyone, i am new in the domain, and i need to auth my users thanks to an existing active directory with LDAP protocol but i don't know how i can do with refine, which auth service to use ... TY
2 Replies
kapa.ai
kapa.ai10mo ago
Hi @Louis.v. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Hmm, I don't know enough to give you a confident answer yet. The extracts provided do not contain specific information about LDAP authentication with Refine. However, Refine does offer a flexible architecture that allows you to implement various authentication strategies. You can create your own Authentication approach using Refine and customize the AuthProvider methods according to your needs. Here is a general example of how to set up an AuthProvider in Refine:
import { Refine, AuthProvider } from "@refinedev/core";

export const authProvider: AuthProvider = {
login: async ({ email, password }) => {
const { status } = handleLogin(email, password);

if (status === 200) {
return { success: true, redirectTo: "/dashboard" };
} else {
return {
success: false,
error: { name: "Login Error", message: "Invalid credentials" },
};
}
},
check: async (params) => ({}),
logout: async (params) => ({}),
onError: async (params) => ({}),
register: async (params) => ({}),
forgotPassword: async (params) => ({}),
updatePassword: async (params) => ({}),
getPermissions: async (params) => ({}),
getIdentity: async (params) => ({}),
};

const App = () => {
return <Refine authProvider={authProvider}>...</Refine>;
};
import { Refine, AuthProvider } from "@refinedev/core";

export const authProvider: AuthProvider = {
login: async ({ email, password }) => {
const { status } = handleLogin(email, password);

if (status === 200) {
return { success: true, redirectTo: "/dashboard" };
} else {
return {
success: false,
error: { name: "Login Error", message: "Invalid credentials" },
};
}
},
check: async (params) => ({}),
logout: async (params) => ({}),
onError: async (params) => ({}),
register: async (params) => ({}),
forgotPassword: async (params) => ({}),
updatePassword: async (params) => ({}),
getPermissions: async (params) => ({}),
getIdentity: async (params) => ({}),
};

const App = () => {
return <Refine authProvider={authProvider}>...</Refine>;
};
(Source: Refine Documentation (https://refine.dev/docs/guides-concepts/authentication#auth-provider)) For more specific guidance on implementing LDAP authentication, I recommend checking out the Refine Documentation (https://refine.dev/docs/guides-concepts/authentication) and the Refine Community (https://community.refine.dev/) for additional resources and support. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai10mo ago
<@386254475612127233> kapa.ai is still learning and improving, please let us know how it did by reacting below

Did you find this page helpful?