Page 1 of 2

Re: Web server basic authentication

Posted: Sun Aug 31, 2014 10:36 am
by Smotz
Sorry but I am not getting it...how do I enable authentication on my RA webpage?

Re: Web server basic authentication

Posted: Sun Aug 31, 2014 3:48 pm
by binder
Smotz wrote:Sorry but I am not getting it...how do I enable authentication on my RA webpage?
You need to grab the latest copy of the libraries from the DEV branch. Then you must add this to your setup() of your INO.

Code: Select all

ReefAngel.Network.WifiAuthentication("username:password");
Then, that will require that username and password combination to access your controller through the web page.
So you could do:

Code: Select all

ReefAngel.Network.WifiAuthentication("myuser:pass4321");
Or whatever else you wanted to do. The only requirement is that string of your username:password must be 50 chars or less, including the colon (:).

Re: Web server basic authentication

Posted: Sun Aug 31, 2014 4:11 pm
by Smotz
binder wrote:
Smotz wrote:Sorry but I am not getting it...how do I enable authentication on my RA webpage?
You need to grab the latest copy of the libraries from the DEV branch. Then you must add this to your setup() of your INO.

Code: Select all

ReefAngel.Network.WifiAuthentication("username:password");
Then, that will require that username and password combination to access your controller through the web page.
So you could do:

Code: Select all

ReefAngel.Network.WifiAuthentication("myuser:pass4321");
Or whatever else you wanted to do. The only requirement is that string of your username:password must be 50 chars or less, including the colon (:).
This is perfect! Thank you as always.

Can I have multiple lines for multiple usernames?
Will this affect the portal in anyway?

Re: Web server basic authentication

Posted: Sun Aug 31, 2014 5:11 pm
by binder
Smotz wrote: This is perfect! Thank you as always.

Can I have multiple lines for multiple usernames?
No
Will this affect the portal in anyway?
I think it will because the portal will have to use the username and password to connect to your controller. However, I believe Roberto has this implemented and working now so the portal can connect but I am not 100% positive. He (or someone else) will have to confirm this (also, I have not checked, but I'm sure you could check on the portal for some authentication).

Re: Web server basic authentication

Posted: Sun Aug 31, 2014 7:52 pm
by Smotz
binder wrote:
Smotz wrote: This is perfect! Thank you as always.

Can I have multiple lines for multiple usernames?
No
Will this affect the portal in anyway?
I think it will because the portal will have to use the username and password to connect to your controller. However, I believe Roberto has this implemented and working now so the portal can connect but I am not 100% positive. He (or someone else) will have to confirm this (also, I have not checked, but I'm sure you could check on the portal for some authentication).
Gotcha - Everything is working except the portal.
Roberto, can you chime in? I cannot figure out where on the portal to set this.

Re: Web server basic authentication

Posted: Sun Aug 31, 2014 7:54 pm
by rimai
Not implemented yet.

Re: Web server basic authentication

Posted: Sun Aug 31, 2014 8:02 pm
by Smotz
rimai wrote:Not implemented yet.
Gotcha. Well, looks good so far!

Re: Web server basic authentication

Posted: Fri Dec 19, 2014 7:50 pm
by Sacohen
Was the Webserver Authentication enabled on the Portal after the update to the 1.1.1 libraries.

I uncommented it from my code and when I load the portal I get Unreachable Address and it pulls the info from the database.

When I comment it out again the portal works fine.

Code: Select all

ReefAngel.Network.WifiAuthentication("Sacohen:xxxxxxxx");
With the xxx's representing my actual password.

It is in my setup section.

Does the password need to be the same as what the portal uses or the Portal key?
For example the portal or forum password maybe ABCDefgh but my Portal key is AbCdEfGh

Re: Web server basic authentication

Posted: Fri Dec 19, 2014 8:45 pm
by Sacohen
I tried changing my forum password to match my Portal Key and the Server Authentication in my code and still got Unreachable Address.

Re: Web server basic authentication

Posted: Sat Dec 20, 2014 9:47 am
by rimai
Not implemented yet :(
I'll try to get to this next week.

Re: Web server basic authentication

Posted: Sat Dec 20, 2014 10:06 am
by Smotz
following

Re: Web server basic authentication

Posted: Sat Dec 20, 2014 1:20 pm
by Sacohen
Thanks Roberto

Re: Web server basic authentication

Posted: Sat Dec 20, 2014 5:26 pm
by pandimus
This wouldn't happen to be the reason I've been getting authentication errors is it?

Re: Web server basic authentication

Posted: Sat Dec 20, 2014 5:54 pm
by Sacohen
Authentication errors where???

Have you added the web authentication to your code?

Re: Web server basic authentication

Posted: Sat Dec 20, 2014 6:24 pm
by pandimus
I get it constantly on the Android app, I haven't added any code.

Re: Web server basic authentication

Posted: Sat Dec 20, 2014 6:56 pm
by Sacohen
Then no.
The Android app has the authentication in it already.

Try changing your timeout time and # of retries.

Re: Web server basic authentication

Posted: Sat Dec 27, 2014 4:02 pm
by rimai
I added controller authentication username and password fields to your user profile page.
Please go there and enter the same username and password you coded in your controller.
The portal should recognize it and apply the authentication automatically.
Please let me know how it goes.

Re: Web server basic authentication

Posted: Sun Dec 28, 2014 11:54 am
by Sacohen
Where are the authentication username and password fields?
I don't see them.
I looked under the portal settings and nothing new is there.

Image

Re: Web server basic authentication

Posted: Sun Dec 28, 2014 1:48 pm
by rimai
On your forum user profile page.
It's a more secure place to have them stored.

Re: Web server basic authentication

Posted: Sun Dec 28, 2014 3:30 pm
by Sacohen
Works great. Thanks.
I don't really use the U-App, but it would need to be added to that when you have a chance.
The Andiod App works great.

I'll try to get Russ at Reftronic to implement something on this page.

Re: Web server basic authentication

Posted: Sun Dec 28, 2014 3:46 pm
by rimai
Actually he mentioned that he doesn't want to store auth passwords in his end.
We do have an issue open for read only anonymous access:
https://github.com/reefangel/Libraries/issues/197
Should be coming on the next release.

Re: Web server basic authentication

Posted: Sun Dec 28, 2014 4:50 pm
by Sacohen
OK.

Re: Web server basic authentication

Posted: Sun Dec 28, 2014 4:50 pm
by Sacohen
OK.

Re: Web server basic authentication

Posted: Tue Dec 30, 2014 10:48 am
by rimai
Can you try the latest dev branch?
I included the anonymous access for command /sa

Re: Web server basic authentication

Posted: Tue Dec 30, 2014 12:35 pm
by Sacohen
Just tried it and the Portal is giving me an Unreachable Address and Reeftronics is "Due to communication error, real-time status information is unavailable".

The dev code I got from here https://github.com/reefangel/Libraries/tree/dev.

https://github.com/reefangel/Libraries/archive/dev.zip

Re: Web server basic authentication

Posted: Tue Dec 30, 2014 12:55 pm
by Sacohen
Wait. Something else is going on. I switched back to the released code and the Portal is still showing Unreachable Address, but the Andriod App is working fine.

I need to look into this a bit more.

Re: Web server basic authentication

Posted: Tue Dec 30, 2014 2:13 pm
by Sacohen
Using the released code the portal works fine if I comment out the authentication in my code and remove it from my profile.

If I add it back in it connects and reads ready.

If I switch to the dev code with my authentication info in the profile I get Unreachable Address on the portal.

Re: Web server basic authentication

Posted: Tue Dec 30, 2014 7:44 pm
by ReefingHavoc
Trying to follow along as had to update my IP address and the IOS App is working fine after the address change but when I updated the Portal IP address I get "unreachable address". If I click on the IP address above the status a new tab opens up with "Reef Angel Controller Web Server". Not sure what is going on...

Re: Web server basic authentication

Posted: Wed Dec 31, 2014 4:27 pm
by rimai
I think it is fixed this time.
Can you try the updated dev branch?
If this works, we probably need to contact reeftronics to tell them the anonymous page is /sa and not /r99 anymore

Re: Web server basic authentication

Posted: Wed Dec 31, 2014 5:40 pm
by Sacohen
I'll try it tomorrow.
I'm at a New Years Eve block party.

Happy New Years. :)