How to login users via an API

gary-arkade
Shopify Expert
4 0 1
 
content-type: json

{
    "form_type": "customer_login",
    "customer[email]": "test@test.com",
    "customer[password]": "test"
}
 
I can login a user. i.e. return the welcome html page.
But if I doing very often, I will get a "I am not robot page"
 
Is there any api allowing me to login easily?
 
 
Replies 6 (6)
KarlOffenberger
Shopify Partner
1873 184 863

Hi,

 

The captcha is triggered when too many accounts are being created from one IP during a 24 hrs period. Guess the same applies for login attempts. If you need that disabled you can contact support - you cannot turn off this security measure yourself.

 

Question is - why do you need to login that often? Sessions.

 

Depending on what you need to do, you can also take a look at Storefront API customAccessTokenCreate and a fantastic overview of a few use cases here.

 

Best wishes!

Liked this post? You might also like our fantastic upsell apps Candy Rack, Last Upsell post-purchase and Candy Cart or offer free gifts with Gift Box. All made with ❤️  and care by Digismoothie
gary-arkade
Shopify Expert
4 0 1

@KarlOffenberger, Basically, I am building a react native app (proof of concept) to display shopify website. There is a component called webview (think like iframe).

 

So each time my app reload itself, the webview will post to https://xxx.myshopify.com/account/login with the following json data (by using chrome inspector)

 

{
  "form_type": "customer_login",
  "customer[email]": "user",
  "customer[password]": "pass"
}
 
if login successfully, my webview will always have a login session, so I can browse products, checkout. (It is like a password less experience)
 
I know that multi pass in shopify plus can do it, but it is expensive. (so this option will be ignored for now). We come up a hacky way to see whether it will work. 
 
In Summary,
I want my react native app able to login (with hardcode username and password at the moment), if customers close the app and reopen it, the login session should be still there. (I hope I explain it clearly.)
Jason
Shopify Expert
10873 190 2177

Outside of Multipass there isn't an API to log customers into Shopify. I would not suggest other approaches like posting the data as it could very well could be trapped by the bot tools. At best you'll have the captcha to deal with.

 

 

I also have plenty of concerns around the security of passing around customer password data like that. Not enough context into methods you're using to comment too much but it's setting off all the spidey senses.

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
asim-zubair
Shopify Partner
5 0 1

Hey Jason

 

How do social login apps work without using Multipass?

Social login app examples, they have example stores as well.

Easy Auth

Social login by NDNAPPS

mdmathewdc
Tourist
4 0 1

https://myshopify.com/account/login

Is this the right URL because it isn't working for me?

pgupta
Shopify Partner
18 0 2

Hi,

 

Is it possible to check whether customer exist in the shopify account using the API? 

 

The postman logic is not working for me. Either some header or authorisation information is missing.