here is the senario, imagine we have 2 websites and we would like to use a game within an umbraco website.
the game page is hosted somewhere else. how can I get the current member who is logged in in umbraco site in Game page by using uREST?
I've found below explanation in the documentation but how can I create a Authentication in .NET? and How Can I get the current User information like ID, Username and so on.
"Authentication
Authentication is managed using custom
QueryString based authentication. Every request must include a set of auth_username
and auth_token key value pairs. Where auth_username is your
Umbraco username and auth_token is your uREST authentication token. See
the documentation on the Token resource for details on how to obtain a
uREST authentication token."
The purpose of uRest is to offer a completley seperated API to Umbraco, which means it wouldn't be possible the share the authentication with that made on the actual site. If this is something you require, then you might be best off taking a look at /Base instead, as this runs in the context of the website, and can therfore access the currently logged in principle.
/Base methods are just regular classes / methods decorated with specific attributes to make them accessible via /Base. They run within the regular web context, so you can do the same as you would do in any regular class / control to get the current member:
namespace { [RestExtension("myAlias")] public class TestClass {
get the current user with uREST?
Hi,
here is the senario, imagine we have 2 websites and we would like to use a game within an umbraco website.
the game page is hosted somewhere else. how can I get the current member who is logged in in umbraco site in Game page by using uREST?
I've found below explanation in the documentation but how can I create a Authentication in .NET? and How Can I get the current User information like ID, Username and so on.
"Authentication
Authentication is managed using custom QueryString based authentication. Every request must include a set of auth_username and auth_token key value pairs. Where auth_username is your Umbraco username and auth_token is your uREST authentication token. See the documentation on the Token resource for details on how to obtain a uREST authentication token."
Hope that makes sense
Thanks
Hi Ali,
The purpose of uRest is to offer a completley seperated API to Umbraco, which means it wouldn't be possible the share the authentication with that made on the actual site. If this is something you require, then you might be best off taking a look at /Base instead, as this runs in the context of the website, and can therfore access the currently logged in principle.
Many thanks
Matt
Hi Matt,
Thanks for quick reply.
Could you please give me a clue of how to use base in order to get the current user?
any sample code or documentation would be helpful
Many Thanks
Ali
Hi Ali,
/Base methods are just regular classes / methods decorated with specific attributes to make them accessible via /Base. They run within the regular web context, so you can do the same as you would do in any regular class / control to get the current member:
Many thanks
Matt
Many Thanks Matt
Ali
is working on a reply...