Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't impersonate user with CloudClient #82

Open
psylinse opened this issue Jun 14, 2020 · 0 comments
Open

Don't impersonate user with CloudClient #82

psylinse opened this issue Jun 14, 2020 · 0 comments
Assignees

Comments

@psylinse
Copy link

@psylinse psylinse commented Jun 14, 2020

I'm using the CloudClient in an Android application. When I try to add something to a user's feed I get "Don't impersonate user" with this code:

        client = CloudClient
            .builder(credentials.apiKey, credentials.token, "jeff")
            .build()
        val feed = client.flatFeed("user")
        feed.addActivity(
            Activity
                .builder()
                .actor("jeff")
                .verb("post")
                .`object`(UUID.randomUUID().toString())
                .extraField("message", message)
                .build()
        ).join()

However, it seems to work fine if I prefix the user with SU: like so:

        client = CloudClient
            .builder(credentials.apiKey, credentials.token, "jeff")
            .build()
        val feed = client.flatFeed("user")
        feed.addActivity(
            Activity
                .builder()
                .actor("SU:jeff")
                .verb("post")
                .`object`(UUID.randomUUID().toString())
                .extraField("message", message)
                .build()
        ).join()

With the other libraries (Swift/JS/etc.) I don't have to do this. Am I doing something wrong? What's the significance of SU?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.