aniastrzezek / ios-stuart-delivery-sdk

MIT License
1 stars 0 forks source link

Only suitable for prototyping ? #1

Open thibauddavid opened 7 years ago

thibauddavid commented 7 years ago

Hi,

I've just came accros your SDK. It's interesting, but I guess it's only usable for prototyping purpose, as you seem to need to embed the clientKey and secretKey into the application bundle. In production, all Stuart communication should be done via a server, right ?

Thanks !

aniastrzezek commented 7 years ago

Hi @thibauddavid! You don't need to embed client ID and secret.

You can receive credentials from server and set them in your app using: [[StuartClient defaultClient] setClientID:clientID clientSecret:clientSecret];

thibauddavid commented 7 years ago

As long as you get them in your app, either by including them in bundle or by sending them from server, that mean literally anyone could get them, or could simply by swizzling some methods in your app be able to gain a total access on your Stuart account via API.

A clientSecret is mean to stay secret, that's why this must be done from a server, and never be known by any client...

aniastrzezek commented 7 years ago

@thibauddavid Do you think that the good solution will be to receive the token from the backend and reuse it in this library?

The current solution was created for the app which could use backend only for receiving client credentials (there was no time and no people to implement anything more 😞)

thibauddavid commented 7 years ago

In fact, I think the good solution for a production app will be to absolutely don't use this... Whatever a secretKey or a token is directly embed on the bundle, or received from a webservice, it would be a major security flaw as a client has access to a master access to do whatever he wants with your stuart account. This could result in thousand of fake delivery order, or even worse...

aniastrzezek commented 7 years ago

😃 OK, but the purpose of this library is to communicate with Stuart from the iOS app in case you don't have a backend and what you are suggesting is redirecting all the calls through the backend.

thibauddavid commented 7 years ago

Exactly, but you really must not directly communicate from your iOS client to StuartAPI, because of introduced major security flaws. You don't have other choices than communicating through a backend. I'm sorry if you loose time developing this, but except for prototyping purpose, this lib is useless, and really dangerous for the customer you are developing an app which uses it.