Is there any available sample of WIF support while using WebSync pub/sub

14 views
Skip to first unread message

Francois Belair

unread,
Feb 27, 2013, 3:18:53 PM2/27/13
to web...@googlegroups.com
Hello,

Our solution support WIF in order to enforce the identity of our users. We therefore need to support WIF under the WebSync pub/sub since our notification will be user based. Are there any sample of WIF interaction with WebSync?

Thank you in advance.

Jerod Venema

unread,
Feb 27, 2013, 6:03:30 PM2/27/13
to web...@googlegroups.com
Hey Francois!

WebSync integrates with basically any authentication scheme you need fairly easily. I've had discussions with some other people @ your company and will have a sample project to you shortly, but for future visitors, the client side just needs to be set up to use WIF per Microsoft's guidelines, and then in WebSync, everything will pass through as expected, and you simply add some standard authentication:

[WebSyncEvent(EventType.BeforeConnect)]
public static void RequireAuthenticationForConnect(object sender, WebSyncEventArgs e)
{
    // authenticate new Client connections
    if (!e.Context.User.Identity.IsAuthenticated)
    {
        e.Cancel("Must be authenticated to connect!");
    }
}

[WebSyncEvent(EventType.BeforePublish)]
public static void RequireAuthenticationForPublish(object sender, WebSyncEventArgs e)
{
    // authenticate Publisher instances separately since they don't connect first
    if (e.Source == EventSource.Publisher)
    {
        if (!e.Context.User.Identity.IsAuthenticated)
        {
            e.Cancel("Must be authenticated to publish!");
        }
    }
}

Best,


--
You received this message because you are subscribed to the Google Groups "WebSync" group.
To unsubscribe from this group and stop receiving emails from it, send an email to websync+u...@googlegroups.com.
To post to this group, send email to web...@googlegroups.com.
Visit this group at http://groups.google.com/group/websync?hl=en.
To view this discussion on the web visit https://groups.google.com/d/msg/websync/-/ZhACbp7VDBQJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Jerod Venema
Frozen Mountain Software
919-300-5141 (United States)
604-227-2453 (Canada)
888-379-6686 (Extension 101)
Reply all
Reply to author
Forward
0 new messages