Focuses on API authentication, access scopes, and permission management.
Hey guys!
Im about to implement BankID, an way to idenitfy a user in Sweden and Denmark. This is not an app in the normal sense and it does not integrate with shopify like a normal third party app would. There is no "install button" so to speak.
We use javascript to make calls to the serivce and when the user has identifed him self the service returns an answer on who this person is. Then i will either create a customer profile if it does not alreay exist or, log the user into an existing.
My dilemma is where to put the code to this. I have looked around a little but have not found a great example. Any ideas or perhaps someone can point me in the right direction?
Thanks !
Hi Knofan,
How would the customer identify themselves? If this needs to be on a customer account page, you may need to look into using a customer account extension to achieve this, but this is still in developer preview. What format is the code in that BankID has provided?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi Liam
I made a test page on my site to see that the button apear and the service was called. The result is a popup window with QR-code. This code is read by an app in a phone, a code is provided (or face id) by the phone owner. If the user is identified then the serivce returns information about him/her.
Here are several services that encapsulates this functionallity for faster implementation and that is what im using. You can read more here how it works with java script for example. JavaScript - Integrations - Criipto Verify Documentation
One can also use the api from bankid directly but there is alot more coding to be done in that case. even tho it will be "cleaner".
Here is one example of an user Authorization
<script type="text/javascript">
document
.getElementById('login-button-popup')
.addEventListener('click', () => {
criiptoAuth.popup
.authorize({
width: 300,
height: 400,
redirectUri: 'http://localhost:8000/example/index.html',
acrValues: 'urn:grn:authn:dk:mitid:substantial',
})
.then((result) => {
console.log(result, result.id_token, result.claims);
document.getElementById('result').textContent =
JSON.stringify(result);
});
});
</script>