This project is read-only.
Ejemplo de autenticación basica

//Clase de negocio
public class GosocketApi
{
	private ApiManager GosocketApiManager { get; set; }

	public GosocketApi(string uri, Guid appid, string toke)
	{
		GosocketApiManager = new ApiManager(uri, appid, toke);
	}

	public User GetUser()
	{
		return GosocketApiManager.GetUser();
	}

	public Account GetAccount(Guid MyAccoundId)
	{
		var accounts = GosocketApiManager.GetMyAccounts();

		return accounts.SingleOrDefault(a => a.AccountId == MyAccoundId);
	}

	public Account GetProvider(Guid MyAccoundId, Guid AccountId)
	{
		var providers = GosocketApiManager.GetVendors(MyAccoundId);

		return providers.SingleOrDefault(a => a.AccountId == AccountId);
	}
}

Guid appId = Guid.Parse("*gui*");
string token = Request[token].ToString();

var bizGosocket = new GosocketApi("https://api.gosocket.net/", appId, token);
var currentUser = bizGosocket.GetUser();

if (currentUser == null)
{
        //Unauthorized.
}

Last edited Apr 30, 2014 at 4:16 PM by jofman, version 1