Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Ali Sheikh Taheri 470 posts 1648 karma points c-trib
    Dec 02, 2011 @ 02:11
    Ali Sheikh Taheri
    0

    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

     

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Dec 02, 2011 @ 09:01
    Matt Brailsford
    0

    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

  • Ali Sheikh Taheri 470 posts 1648 karma points c-trib
    Dec 02, 2011 @ 10:24
    Ali Sheikh Taheri
    0

    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

  • Matt Brailsford 4125 posts 22223 karma points MVP 9x c-trib
    Dec 02, 2011 @ 10:44
    Matt Brailsford
    1

    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:

    namespace 
    {
        [RestExtension("myAlias")]
        public class TestClass {

    [RestExtensionMethod()]
            public static string {

       var user = Memberhip.GetUser();

                return "Hello World";
            }
        }
     
    }

    Many thanks

    Matt

  • Ali Sheikh Taheri 470 posts 1648 karma points c-trib
    Dec 02, 2011 @ 22:02
    Ali Sheikh Taheri
    0

    Many Thanks Matt

    Ali

Please Sign in or register to post replies

Write your reply to:

Draft