public ActionResult Register(string app, string redirectUri)
        {
            var clientId = app;
            var secret = ShortGuid.NewGuid().ToString();
            var code = ShortGuid.NewGuid().ToString();

            var registry = new OAuthEntity(clientId, secret, redirectUri, code) { PartitionKey = clientId, RowKey = secret };
            _oAuthService.Create(registry);

            return RedirectToAction("Index");
        }
 /// <summary>
 /// Delete a registered application.
 /// </summary>
 /// <param name="entityToDelete">Registered application to delete</param>
 public void Delete(OAuthEntity entityToDelete)
 {
     _repository.Delete(entityToDelete);
     _unitOfWork.SubmitChanges();
 }
 /// <summary>
 /// Register a new application.
 /// </summary>
 /// <param name="entityToCreate">Application to register</param>
 public void Create(OAuthEntity entityToCreate)
 {
     _repository.Create(entityToCreate);
     _unitOfWork.SubmitChanges();
 }
 /// <summary>
 /// Deletes an entity in the OAuthRegisteredApps Azure Table.
 /// </summary>
 /// <param name="entityToDelete">OAuthEntity entity to be deleted</param>
 public void Delete(OAuthEntity entityToDelete)
 {
     _unitOfWork.Delete<UserEntity>("OAuthRegisteredApps", entityToDelete.PartitionKey, entityToDelete.RowKey);
 }
 /// <summary>
 /// Creates an entity in the OAuthRegisteredApps Azure Table.
 /// </summary>
 /// <param name="entityToCreate">OAuthEntity entity to be created</param>
 public void Create(OAuthEntity entityToCreate)
 {
     _unitOfWork.Create(entityToCreate, "OAuthRegisteredApps");
 }
 /// <summary>
 /// Updates an entity in the OAuthRegisteredApps Azure Table.
 /// </summary>
 /// <param name="entityToUpdate">OAuthEntity entity to be updated</param>
 public void Update(OAuthEntity entityToUpdate)
 {
     _unitOfWork.Update("OAuthRegisteredApps", entityToUpdate);
 }