I’ve been going through the online materials and h...
# ask-a-descoper
e
I’ve been going through the online materials and have a few questions. * Do you guys store passwords (or hashes) on your end? I’m curious if I can avoid having to use them at all and just rely on other methods. I don’t mind passwords on my desktop because I use Roboform, but on my mobile devices, it’s not viable. Chrome can memorize pwds, but I don’t like that it always stuffs them in whether you want them or not. And I’d rather have PINs on my mobile devices than long passwords, or have a pin sent to the device or email. * You have your sample app … could you guys put something like that into an IFRAME or some js to provide a complete no-code solution for websites? I’m thinking something that would be easy enough to paste a short bit of code into any web age and configure the login panel on the descale dashboard. Have a bit of js that I call, or an API endpoint, that shows the login panel, then I’d get back a JWT or something like that. You’re very close with that demo app; I just don’t want to have to deply a service and maintain it and a bunch of HTML code. * Your sample app refers to an http-server. If I'm on a host with Apache, can I just use that? I'm on a shared hosting platform (cPanel) and I cannot get to a shell.
b
Hi David. Obviously, we highly recommend going with any of the passwordless methods we have - OTPs, Magic Links, Enchanted Links, OAuth, etc. In this case, there is no password being stored anywhere. When you do use passwords, we store the hashes on our side. As for the implementation - although you cannot do it in iFrame, you can still use our low-code option of Descope Flows and only need to embed our component. This can also be a pure HTML site with a very simple code snippet you need to add to your main page. Then with a simple verification code in your backend, you can confirm the user is authenticated. See here: https://docs.descope.com/build/guides/gettingstarted/ (select HTML as frontend). Can you share a bit more about what you are building? What technology are you using that hosting the HTML is a challenge?
e
I'm using Delphi with TMS WEB Core, which lets you write your app in the Delphi IDE using Object Pascal, and it's transpiled into javascript and set up so it runs as a web app. Under the hood, it uses HTML, CSS, and JS. It works with any number of JS libs, like bootstrap, etc., so anything that can be laid out using JS is easy. Embedding HTML isn't quite as simple, and I think it all needs to go inside of DIVs and have it's own CSS.
b
OK understood. So how about using the following approach - declare the div, and then in a script tag, embed the component by replacing the content of that DIV programmatically? Something like this:
Copy code
script>
	if (document.readyState === "loading") {
		document.addEventListener("DOMContentLoaded", afterDOMLoaded);
	} else {
		afterDOMLoaded();
	}
	function afterDOMLoaded() {
		const descopeWcEleBox = document.getElementById("descopeDiv");
		descopeWcEleBox.focus();
		if (!descopeWcEleBox || descopeWcEleBox.length === 0) {
			console.log("cannot find element box");
			return;
		}
		descopeWcEleBox.innerHTML = `<descope-wc project-id="<Project ID>" flow-id="sign-up-or-in" theme="dark"></descope-wc>`;
		const descopeWcEle = document.getElementsByTagName("descope-wc");
		if (!descopeWcEle || descopeWcEle.length === 0) {
			console.log("cannot find descope-wc");
			return;
		}
		descopeWcEle[0].addEventListener("success", (res) => {
			const obj = {
				firstName: (res.detail.user.name) ? res.detail.user.name.split(" ")[0] : "",
				lastName: (res.detail.user.name) ? res.detail.user.name.split(" ").splice(1).join(" ") : "",
				name: res.detail.user.name,
				email: res.detail.user.email,
				userId: res.detail.user.userId,
				origin: "website_signup"
			}
			window.analytics.identify(res.detail.user.userId, obj);
			window.analytics.track('pe22419231_website_signup', obj);

		window.location.href = "<> redirect URL after login";
		});
	}
</script>
@enough-vr-69041 - let me know if this helped, or if you need any assistance.
e
@breezy-evening-56597 I have been focusing on another aspect of my app that needs to get done first. I'll let you know. Thanks for the info.
b
Sounds good. We are here for you.
👍 1