SEPIA-Framework / sepia-docs

Documentation and Wiki for SEPIA. Please post your questions and bug-reports here in the issues section! Thank you :-)
https://sepia-framework.github.io/
237 stars 16 forks source link

Sorry <user> you need permission to use this smarthome service #20

Closed sewolff closed 4 years ago

sewolff commented 4 years ago

Sorry for the bad english in the titel and the text all over. I just tried to install and run SEPIA Framework with an Android-Client which worked fine at first. The connection to my fhem-server seems to work fine as well, I can toggle devices via the HTTP Client and the admin login. I added a new user and gave him the smarthomeguest and the smarthomeadmin roles.

If I try to use the Android-Client with my new user I get the Answer: "du brauchst erst eine Erlaubnis um diesen Smart-Home-Service zu nutzen"

I am using the version v2.4.1b

Only hint I found in the sepia-websocket-server-java is that my user seemingly only has user permission. The web-interface tells me that my user has the smarthomeguest and smarthomeadmin roles ??

fquirin commented 4 years ago

Hello,

just a few questions to double-check:

sewolff commented 4 years ago

Wow, you are fast !

The FHEM-Server and Control HUB are running on different systems but switching via the Control HUB using the Admin login works fine.

The roles are still there if I push "get roles"

fquirin commented 4 years ago

I just happened to be around ;-)

So you have user that shows up in the Control HUB with the required 'samrthomeguest' role, in your app the same user is missing the role (at least thats what the chat server says in the logs) and both systems (Control HUB and client) are accessing the same SEPIA server?

Since both systems are loading the information from the same source and there should be no caching mechanism this is highly confusing. Could you logout from the app and login again just to see once again what the chat server writes to the log?

sewolff commented 4 years ago

I've logged out and back in, the websocket log gives me the following:

2020-02-21 12:49:05 [qtp1298622027-15] INFO SepiaAuthenticationHandler - Authenticated: uid1005, roles: ["user","assistant"], deviceId: serv1 2020-02-21 13:08:08 [qtp1298622027-18] INFO SepiaAuthenticationHandler - Authenticated: uid1007, roles: ["user"], deviceId: a1 2020-02-21 13:08:08 [qtp1298622027-12] INFO ChatsElasticsearchDb - getAllChannelsWithMissedMassegesForUser - restored data for user ID 'uid1007' in 3ms. 2020-02-21 13:08:33 [qtp1298622027-15] INFO SepiaAuthenticationHandler - Authenticated: uid1007, roles: ["user"], deviceId: a1

fquirin commented 4 years ago

Ok so this info seems to be fresh. Could you maybe make a screenshot of the Control HUB showing the user roles for "uid1007"?

sewolff commented 4 years ago

Sorry, you guided me to my very own failure. I did not use the UserID uid1007 but my login-name for setting the permissions. I used the uid1007 now and everything works fine. Thanks a lot for your help and sorry for troubeling you !

fquirin commented 4 years ago

happy to help, hf :-)