Jump to content

Recommended Posts

Posted

We are developing an App that sends data over the Internet to ProcessWire (POST/JSON). We want password to be protected somehow when sending it, but I should be able to compare it to PW's passwords. We were thinking of using md5 encryption, but PW uses different encryption.

How can I be sure that user has active account when they use the App?

Posted

You might want to have a look at my REST API tutorial.

It implements basic HTML authentication which is a standard that is quite secure when used over SSL.
If you use that appoach, then you need to to send base64-encoded credentials (username:password) when your App authenticates with PW.
Then on the PW side you need to decode those into username and password. See how this is done in the Rest Helper php
Then do the login attempt with $session->login('username', 'password'); to see whether the credentials are valid.

 

 

 

  • Like 3
  • Thanks 1
Posted

They don't actually login to the website when they use the API - I just need to know if the password is correct and send confirmation or false. Although, I could use $session->login to check if the credentials are valid. Thanks for help, I'll look into it.

  • Like 1
Posted
2 hours ago, anttila said:

Although, I could use $session->login to check if the credentials are valid.

Do that. Rely on the built-in mechanisms for user authentication and authorization as much as you can, and you have already eliminated three quarters of the security pitfalls of writing a client app. Let your app deal with regular http status codes like 401 instead of custom status messages and you have another ten percent.

:)

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...