Skip to content

Conversation

@ibebbs
Copy link
Contributor

@ibebbs ibebbs commented Feb 4, 2021

PR for issue 39.

Using this code I was able to retrieve feed activities using a client authenticated with a user session token as shown below:

// Executed on the server
var serverConnection = new StreamClient(apiKey, apiSecret);
var clientToken = serverConnection.CreateUserSessionToken(userId);

// Just to verify that the 'server' can retrieve the users feed
var serverResponse = await serverConnection.Feed(feedSlug, userId).GetActivities(); // executes correctly

display($"Activites retrieved on server: {serverResponse.Count()}");

var clientConnection = new StreamClient(apiKey, clientToken);
var clientResponse = await clientConnection.Feed(feedSlug, userId).GetActivities(); // previously failed with "signature is invalid" now succeeds

display($"Activites retrieved on client: {clientResponse.Count()}");

@ibebbs
Copy link
Contributor Author

ibebbs commented Feb 4, 2021

Looks like the CI build needs some environment variables set for credentials.

Copy link
Contributor

@ferhatelmas ferhatelmas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks for this PR 👍

@ferhatelmas
Copy link
Contributor

Looks like the CI build needs some environment variables set for credentials.

@ibebbs secrets aren't exposed to PRs from users don't have write rights, due to security. Will be improved though while going for github action.

Thanks again!

@ferhatelmas ferhatelmas merged commit a5048c1 into GetStream:master Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants