Skip to content

Instantly share code, notes, and snippets.

View woloski's full-sized avatar

Matias Woloski woloski

View GitHub Profile
@woloski
woloski / issue.md
Created July 11, 2012 15:33
issue with jabbr and bootrapper pre appstart

I am implementing WIF support for federated auth in Jabbr and I am registering WIF http modules on PreAppStart. The thing is that I need to get access to some config items via IApplicationSettings and to get access to that I need the container. So we had to move Bootstrapper to use PreAppStart instead of post. But after moving Bootstrapper to PreAppStart the hubs are not getting injected, seems like the resolver didn't discovered the Chat type with its ctor.

[MissingMethodException: No parameterless constructor defined for this object.]
   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache) +98
   System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241
   System.Activator.Creat
@woloski
woloski / gist:3145640
Created July 19, 2012 17:52
link account jabbr
private void LinkAccount(IJabbrRepository repository, IChatService chatService, HttpContext context, string userIdentity, string username, string email)
{
// Try to get the user by identity
ChatUser user = repository.GetUserByIdentity(userIdentity);
// No user with this identity
if (user == null)
{
// See if the user is already logged in (via cookie)
@woloski
woloski / HttpDomainRoute.cs
Created September 22, 2012 13:07
HttpDomainRoute
public class HttpDomainRoute
: HttpRoute
{
private Regex domainRegex;
private Regex pathRegex;
public HttpDomainRoute(string domain, string routeTemplate, HttpRouteValueDictionary defaults, HttpRouteValueDictionary constraints)
: base(routeTemplate, defaults, constraints)
{
this.Domain = domain;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Web;
using System.Linq;
using DotNetOpenAuth.AspNet;
using DotNetOpenAuth.AspNet.Clients;
@woloski
woloski / SharePoint Auth0 Output
Last active December 15, 2015 03:19
Auth0 SharePoint Succesful Installation
PS C:\> Enable-Auth0 -auth0Domain:"foo.auth0.com" -clientId:"Jr22cCJ3C....b6AXQKws" -webAppUrl:"http://sp2010app:8002" -identifierClaimType:"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -claims:@("Email|http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress") -Verbose
VERBOSE: Adding Microsoft.Sharepoint.Powershell Snapin
VERBOSE: Leaving BeginProcessing Method of Get-SPShellAdmin.
VERBOSE: Leaving ProcessRecord Method of Get-SPShellAdmin.
VERBOSE: Leaving EndProcessing Method of Get-SPShellAdmin.
VERBOSE: Downloading federation metadata from
http://foo.woloski.auth0.com/wsfed/Jr22cCJ3C....b6AXQKws/FederationMetadata/2007-06/FederationMetadata.xml
VERBOSE: Check App exists
VERBOSE: Leaving BeginProcessing Method of Get-SPWebApplication.
@woloski
woloski / WifCookieAuthProvider.cs
Created May 29, 2013 14:29
ServiceStack WIF cookie auth provider
using System.Linq;
using System.Threading;
using Microsoft.IdentityModel.Claims;
using ServiceStack.Common.Web;
using ServiceStack.Configuration;
using ServiceStack.ServiceInterface;
using ServiceStack.ServiceInterface.Auth;
namespace YourApp
{
@woloski
woloski / README.md
Last active December 18, 2015 23:49
Auth0 script for WCF Membership wrapper
  1. Create a new Database Connection in Auth0 Dashboard
  2. Give it an arbitrary name (myapp.com)
  3. Delete the content and paste the content of the script
  4. Replace the BASE_URL with yours
  5. Click on Try button and check if it works
  6. You can now use the Login Widget through https://YOUR_SUBDOMAIN.auth0.com/login?client=YOUR_CLIENT_ID (both values can be found on Settings)
@woloski
woloski / custom-widget.css
Last active December 19, 2015 13:59
Auth0 Login Widget customization
/* ------------------ GENERAL --------------- */
/* change default fonts */
@import url(https://fonts.googleapis.com/css?family=Open+Sans:700,800,400);
.popup {
font-family: 'Open Sans', sans-serif;
}
/* login widget width and centered position */
.popup .overlay .onestep {
@woloski
woloski / eng.md
Last active March 29, 2017 18:25
We want to grow our small team at Auth0!

Senior Software Engineers

Remote required

Auth0 is a privately-held tech company based in Seattle, WA. We have a distributed team working remotely from Seattle, Buenos Aires and Cordoba.

We're building the company we always wanted, with people who share the same passion for technology, solutions and customers.

@woloski
woloski / auth0.py
Last active June 14, 2017 21:12
this shows a very simple bare bones example of authenticating with Auth0 using standard python libraries
import webapp2
import urllib2
import urllib
import json
## CHANGE THIS
CLIENT_ID = "vYPeq7LGf1utg2dbDlGKCwGKgy94lPH0"
CLIENT_SECRET = "DLQ5dWkNMwPlUWo2jqVkbG1PFyeMvV60HEJaW0FioeI4ZxGaAW73BiqRBZmRk29v"
DOMAIN = "contoso.auth0.com"
CALLBACK_URL = "http://localhost:8080/callback"