Endpoint is already assigned to different user

542 views
Skip to first unread message

Søren Jepsen

unread,
Feb 5, 2016, 9:45:48 AM2/5/16
to Kaa project
- What does "Endpoint is already assigned to different user" mean?
- and how does one unassign the endpoint? 


2016-02-05 14:42:05,884 [EPS-endpoint-dispatcher-12] WARN  o.k.k.s.c.d.s.EndpointServiceImpl - Endpoint is already assigned to different user 56ae2eb5f09f2707c00f2677. Unassign it first!.
2016-02-05 14:42:05,885 [EPS-endpoint-dispatcher-12] WARN  o.k.k.s.o.s.u.DefaultEndpointUserService - [gG6G7Juzh2XrPER/Gos3aZ+wA6A=] failed to attach endpoint with access token 000000007a9d791e and user 56ae2ce1f09f2707c00f2675
 

Kindly regards.

Igor Kulikov

unread,
Feb 9, 2016, 3:52:22 AM2/9/16
to Kaa project
Hi Søren,

"Endpoint is already assigned to different user" message means that endpoint was previously attached to some user as a result of performing attach procedure on endpoint SDK.
In order to unassign the endpoint from the user (owner) the detachEndpoint function on the endpoint side should be executed first.
The exact key hash of detaching endpoint should be passed to this function. This can be executed by any endpoint which is already attached to this user.
Finally, there are two options to attach endpoint to new user:
   1) by any endpoint which is already attached to new user(owner) - execute attachEndpoint function with exact key hash of attaching endpoint;
   2) on attaching endpoint side - execute attachUser function with correct external user credentials (user id and user access token).

Thanks,
Igor

Søren Jepsen

unread,
Feb 11, 2016, 12:45:36 PM2/11/16
to Kaa project
Hi, Igor!

Thanks for the detailed explanation.

1. Suppose the endpoint was attached to a user - and in the meantime the endpoint's endpointKeyHash has changed - is it then still possible to detach the device from the user?

2. Is there a possibility to attach a device to multiple accounts/users? - I'm currently working on controlling a home ventilation system, where more than one user should be able to control the device from a mobile device.

Kindly regards,
Søren

Andrew Shvayka

unread,
Feb 11, 2016, 1:49:59 PM2/11/16
to Kaa project
Hi, Soren!

1. I assume your are talking about endpointAccessToken. EndpointKeyHash is constant and can't change. 
    Let's assume there are two endpoints that belong to same user - endpoint A and endpoint B. Endpoint A can detach endpoint B and vise versa. 
    You can always get a list of attached endpoints using findEventListeners API call. Once you have a list, you can use KaaClient.detachEndpoint to detach chosen endpoint. 
2. This is possible using custom user verifier. You can treat home id as a main entity (user) and pass encoded physical user id and physical user password in user access token. 
    Then your custom verifier can check physical user id and password against your custom storage/logic.

Thanks,
Andrew

Søren Jepsen

unread,
Feb 12, 2016, 4:40:15 AM2/12/16
to Kaa project
Hi, Andrew!

Thanks for the explanation!

When attaching an endpoint allready belonging to another user (attachEndpoint) - would it be possible to add information in the SyncResponseResultType or the like - detailing the endpoint is allready registered to another user?

Andrew Shvayka

unread,
Feb 15, 2016, 3:10:01 AM2/15/16
to Kaa project
Hi!

Yes, this is in our todo list. We are going to introduce more accurate error codes. We will introduce this improvements in the following story.

Thanks,
Andrew

Søren Jepsen

unread,
Feb 15, 2016, 4:08:32 AM2/15/16
to Kaa project
Great!

One last question..

What happens if two different endpoints by accident ends up with the same EndpointAccessToken - are both endpoints blacklisted?

Andrew Shvayka

unread,
Feb 15, 2016, 5:05:22 AM2/15/16
to Kaa project
This cause server side issues for handling attach/detach requests for both endpoints. This is the main issue that we will address in the story that i have mentioned.

Thanks,
Andrew

hasan tir

unread,
Jul 30, 2018, 3:16:05 AM7/30/18
to Kaa project
hello 
i am trying to attach a endpoint to a user with attachUser function but i do not khow اhow to get user access token.
Can you guide me?
thank you
Reply all
Reply to author
Forward
0 new messages