<?xml version="1.0" encoding="utf-8"?>
<rss version="0.92">
<channel>
<title>SecuObs.com</title>
<link>http://www.secuobs.com</link>
<description>Observatoire de la securite Internet</description>
<language>fr</language>
<webMaster>webmaster@secuobs.com</webMaster>
 <item><title>Moving to a new Blog</title><description>2012-05-14 16:57:06 - www.leastprivilege.com :    In the next days I will move my blog to WordPress The domain name will stay the same, but the permalinks won t  unfortunately  To make the transition automatically, use this feedburner feed that I will update once the switch is done  http feedsfeedburnercom leastprivilege  IMAGE  </description><link>http://www.secuobs.com/revue/news/375409.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/375409.shtml</guid></item>
<item><title> API for the X509 Certificate Store</title><description>Secuobs.com : 2012-04-20 10:27:07 - www.leastprivilege.com -    It is annoying how often I write code directly against X509Store Maybe this will end this once and for all  var    cert      X509   CurrentUserMyThumbprintFindFirst     abc       source code here  IMAGE  </description><link>http://www.secuobs.com/revue/news/371025.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/371025.shtml</guid></item>
<item><title>ThinktectureIdentityModelHttp and the ASPNET Web API CodePlex bits</title><description>Secuobs.com : 2012-04-11 22:01:14 - www.leastprivilege.com -    I will keep the github repo in sync with the major releases of Web API  like Beta, RC, RTM  Because of the changes made to Web API after beta, my current bits don t build against the CodePlex version anymore Today I installed a build environment for the CodePlex bits, and migrated my code It turns out the changes are pretty easy  Simply replace RequestGetUserPrincipal  with ThreadCurrentPrincipal   I will update the repo when RC comes out  IMAGE  </description><link>http://www.secuobs.com/revue/news/369471.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/369471.shtml</guid></item>
<item><title>Identity in NET 45Part 4  Claims over Kerberos</title><description>Secuobs.com : 2012-04-07 14:07:33 - www.leastprivilege.com -    Today I found this article about the new Kerberos features in Windows Server 8 It also mentions claims and how to enable them  IMAGE  Made me smile    IMAGE  </description><link>http://www.secuobs.com/revue/news/368734.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/368734.shtml</guid></item>
<item><title>Thinktecture IdentityServer and Contrib Project now on GitHub</title><description>Secuobs.com : 2012-04-04 20:42:01 - www.leastprivilege.com -    title says it all really I even have a contribution from the community already   a user repository that authenticates against Active Directory Thanks Marcel Scherpenisse URLs are  https githubcom thinktecture ThinktectureIdentityServer https githubcom thinktecture ThinktectureIdentityServerContrib  IMAGE  </description><link>http://www.secuobs.com/revue/news/368084.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/368084.shtml</guid></item>
<item><title>Identity in NET 45Part 3   Breaking  changes</title><description>Secuobs.com : 2012-04-04 17:33:10 - www.leastprivilege.com -    I recently started porting a private build of ThinktectureIdentityModel to NET 45 and noticed a number of changes The good news is that I can delete large parts of my library because many features are now in the box Along the way I found some other nice additions   ClaimsIdentity now has methods to query the claims collection, eg HasClaim , FindFirst , FindAll    ClaimsPrincipal has those methods as well But they work across all contained identities Nice    ClaimsPrincipalCurrent retrieves the ClaimsPrincipal from ThreadCurrentPrincipal Combined with the above changes, no casting necessary anymore   SecurityTokenHandler now has read and write methods that work directly with strings This makes it much easier to deal with non-XML tokens like SWT or JWT    A new session security token handler that uses the ASPNET machine key to protect the cookie This makes it easier to get started in web farm scenarios    No need for a custom service host factory or the federation behavior anymore WCF can be switched into  WIF mode  with the useIdentityConfiguration switch  odd name though     Tooling has become better and the new test STS makes it very easy to get started On the other hand   and that was kind of expected   to bring claims into the core framework, there are also some breaking changes for WIF code If you want to migrate  and I would recommend that , most changes to your code are mechanical The following is a brain dump of the changes I encountered    Assembly MicrosoftIdentityModel is gone The new functionality is now in mscorlib, SystemIdentityModel Services  and SystemServiceModel    All the namespaces have changed as well    No IClaimsPrincipal and IClaimsIdentity anymore    Configuration section has been split into  and     WCF configuration story has changed as well   ClaimClaimType is now ClaimType   ClaimCollection is now IEnumerable   IsSessionMode is now IsReferenceMode    Bootstrap token handling is different now   ClaimsPrincipalHttpModule is gone This is not really needed anymore, apart from maybe claims transformation  see here     Various factory methods on ClaimsPrincipal are gone  eg ClaimsPrincipalCreateFromIdentity    SecurityTokenHandlerValidateToken now returns a ReadOnlyCollection    Some lower level helper classes are gone or internal now  eg KeyGenerator     The WCF WS-Trust bindings are gone I think this is a pity They were  really  useful when doing work with WSTrustChannelFactory Since WIF is part of the Windows operating system and also supported in future versions of NET, there is no urgent need to migrate to the 45 claims model But obviously, going forward, at some point you want to make the move  IMAGE  </description><link>http://www.secuobs.com/revue/news/368019.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/368019.shtml</guid></item>
<item><title>Identity in NET 45Part 2  Claims Transformation in ASPNET  Beta 1 </title><description>Secuobs.com : 2012-04-04 08:23:49 - www.leastprivilege.com -    In my last post I described how every identity in NET 45 is now claims-based If you are coming from WIF you might think, great   how do I transform those claims  Sidebar  What is claims transformation  One of the most essential features of WIF  and NET 45  is the ability to transform credentials  or tokens  to claims During that process the  low level  token details are turned into claims An example would be a Windows token   it contains things like the name of the user and to which groups he belongs to That information will be surfaced as claims of type Name and GroupSid Forms users will be represented as a Name claim  all the other claims that WIF provided for FormsIdentity are gone in 45  The issue here is, that your applications typically don t care about those low level details, but rather about  what s the purchase limit of alice  The process of turning the low level claims into application specific ones is called claims transformation In pre-claims times this would have been done by a combination of Forms Authentication extensibility, role manager and maybe ASPNET profile With claims transformation all your identity gathering code is in one place  and the outcome can be cached in a single place as opposed to multiple ones  The structural class to do claims transformation is called ClaimsAuthenticationManager This class has two purposes   first looking at the incoming  low level  principal and making sure all required information about the user is present This is your first chance to reject a request And second   modeling identity information in a way it is relevant for the application  see also here  This class gets called  when present  during the pipeline when using WS-Federation But not when using the standard NET principals I am not sure why   maybe because it is beta 1 Anyhow, a number of people asked me about it, and the following is a little HTTP module that brings that feature back in 45 public       class       ClaimsTransformationHttpModule      IHttpModule   public       void    Dispose      public       void    Init HttpApplication context    contextPostAuthenticateRequest   Context_PostAuthenticateRequest    void    Context_PostAuthenticateRequest    object    sender,    EventArgs    e    var    context    HttpApplication sender Context    no need to call transformation if session already exists if     FederatedAuthenticationSessionAuthenticationModule      null      FederatedAuthenticationSessionAuthenticationModuleContainsSessionTokenCookie contextRequestCookies    return       var    transformer    FederatedAuthenticationFederationConfigurationIdentityConfigurationClaimsAuthenticationManager  if     transformer      null       var    transformedPrincipal   transformerAuthenticate contextRequestRawUrl, contextUser    as    ClaimsPrincipal  contextUser   transformedPrincipal  Thread   CurrentPrincipal   transformedPrincipal        HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/367919.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/367919.shtml</guid></item>
<item><title>Identity in NET 45Part 1  Status Quo  Beta 1 </title><description>Secuobs.com : 2012-03-16 11:01:45 - www.leastprivilege.com -    NET 45 is a big release for claims-based identity WIF becomes part of the base class library and structural classes like Claim, ClaimsPrincipal and ClaimsIdentity even go straight into mscorlib You will be able to access all WIF functionality now from prominent namespaces like  SystemSecurityClaims  and  SystemIdentityModel   yay  But it is more than simply merging assemblies  in fact claims are now a first class citizen in the whole NET Framework All built-in identity classes, like FormsIdentity for ASPNET and WindowsIdentity now derive from ClaimsIdentity Likewise all built-in principal classes like GenericPrincipal and WindowsPrincipal derive from ClaimsPrincipal In other words, the moment you compile your NET application against 45, you are claims-based That s a big  and excellent  change  IMAGE  While the classes are designed in a way that you won t  feel  a difference by default, having the power of claims under the hood  and by default  will change the way how to design security features with the new NET framework I am currently doing a number of proof of concepts and will write about that in the future There are a number of nice  little  features, like FindAll , FindFirst , HasClaim  methods on both ClaimsIdentity and ClaimsPrincipal This makes querying claims much more streamlined I also had to smile when I saw ClaimsPrincipalCurrent  have a look at the code yourself    With all the goodness also comes a number of breaking changes I will write about that, too In addition Vittorio announced just today the beta availability of a new wizard configuration tool that makes it easier to do common things like federating with an IdP or creating a test STS Go get the Beta and the tools and start writing claims-enabled applications  Interesting times ahead   IMAGE  </description><link>http://www.secuobs.com/revue/news/364026.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/364026.shtml</guid></item>
<item><title>ASPNET WebAPI Security 5  JavaScript Clients</title><description>Secuobs.com : 2012-03-15 10:11:55 - www.leastprivilege.com -    All samples I showed in my last post were in C  Christian contributed another client sample in some strange language that is supposed to work well in browsers   JavaScript client scenarios There are two fundamental scenarios when it comes to JavaScript clients The most common is probably that the JS code is originating from the same web application that also contains the web APIs Think a web page that does some AJAX style callbacks to an API that belongs to that web app   Validation, data access etc come to mind Single page apps often fall in that category The good news here is that this scenario just works The typical course of events is that the user first logs on to the web application   which will result in an authentication cookie of some sort That cookie will get round-tripped with your AJAX calls and ASPNET does its magic to establish a client identity context Since WebAPI inherits the security context from its  web  host, the client identity is also available here The other fundamental scenario is JavaScript code  not  running in the context of the WebAPI hosting application This is more or less just like a normal desktop client   either running in the browser, or if you think of Windows 8 Metro style apps as  real  desktop apps In that scenario we do exactly the same as the samples did in my last post   obtain a token, then use it to call the service Obtaining a token from IdentityServer s resource owner credential OAuth2 endpoint could look like this  thinktectureIdentityModelBrokeredAuthentication      function     stsEndpointAddress, scope    this   stsEndpointAddress   stsEndpointAddress  this   scope   scope    thinktectureIdentityModelBrokeredAuthenticationprototype      function        getIdpToken      function     un, pw, callback     ajax  type     'POST'   , cache     false   , url     this   stsEndpointAddress, data    grant_type      password    , username  un, password  pw, scope     this   scope  , success     function     result    callback resultaccess_token   , error     function     error    if     errorstatus   401    alert    'Unauthorized'       else      alert    'Error calling STS  '      errorresponseText          createAuthenticationHeader      function     token    var    tok      'IdSrv '      token  return    tok    return      getIdpToken  getIdpToken, createAuthenticationHeader  createAuthenticationHeader       Calling the service with the requested token could look like this  function    getIdentityClaimsFromService    authHeader   authNcreateAuthenticationHeader token   ajax  type     'GET'   , cache     false   , url  serviceEndpoint, beforeSend     function     req    reqsetRequestHeader    'Authorization'   , authHeader   , success     function     result     each resultClaims,    function     key, val        ' claims'    append    ''      valValue      ''        , error     function     error    alert    'Error  '      errorresponseText      I updated the github repository, you can can play around with the code yourself  IMAGE  </description><link>http://www.secuobs.com/revue/news/363709.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/363709.shtml</guid></item>
<item><title>ASPNET WebAPI Security 4  Examples for various Authentication Scenarios</title><description>Secuobs.com : 2012-03-14 09:28:20 - www.leastprivilege.com -    The ThinktectureIdentityModelHttp repository includes a number of samples for the various authentication scenarios All the clients follow a basic pattern  1  Acquire client credential  a single token, multiple tokens, username password  2  Call Service The service simply enumerates the claims it finds on the request and returns them to the client I won t show that part of the code, but rather focus on the step 1 and 2 Basic Authentication This is the most basic  pun inteneded  scenario My library contains a class that can create the Basic Authentication header value Simply set username and password and you are good to go var    client      new       HttpClient      BaseAddress   _baseAddress   clientDefaultRequestHeadersAuthorization    new       BasicAuthenticationHeaderValue        alice    ,     alice      var    response   clientGetAsync     identity     Result  responseEnsureSuccessStatusCode  SAML Authentication To integrate a Web API with an existing enterprise identity provider like ADFS, you can use SAML tokens This is certainly not the most efficient way of calling a  lightweight service    But very useful if that s what it takes to get the job done private       static       string    GetIdentityToken        var    factory      new       WSTrustChannelFactory     new       WindowsWSTrustBinding       SecurityMode   Transport , _idpEndpoint  factoryTrustVersion      TrustVersion   WSTrust13  var    rst      new       RequestSecurityToken   RequestType      RequestTypes   Issue, KeyType      KeyTypes   Bearer, AppliesTo      new       EndpointAddress       Constants   Realm    var    token   factoryCreateChannel Issue rst     as       GenericXmlSecurityToken     return    tokenTokenXmlOuterXml    private       static       Identity    CallService    string    saml    var    client      new       HttpClient      BaseAddress   _baseAddress   clientDefaultRequestHeadersAuthorization      new       AuthenticationHeaderValue        SAML    , saml  var    response   clientGetAsync     identity     Result  responseEnsureSuccessStatusCode  return    responseContentReadAsAsync Result    SAML to SWT conversion using the Azure Access Control Service Another possible options for integrating SAML based identity providers is to use an intermediary service that allows converting the SAML token to the more compact SWT  Simple Web Token  format This way you only need to roundtrip the SAML once and can use the SWT afterwards The code for the conversion uses the ACS OAuth2 endpoint The OAuth2Client class is part of my library private       static       string    GetServiceTokenOAuth2    string    samlToken        var    client      new       OAuth2Client    acsOAuth2Endpoint  return    clientRequestAccessTokenAssertion  samlToken,  SecurityTokenTypes   Saml2TokenProfile11,  Constants   Realm AccessToken    SWT Authentication When you have an identity provider that directly supports a  simple  web token, you can acquire the token directly without the conversion step ThinktectureIdentityServer eg supports the OAuth2 resource owner credential profile to issue SWT tokens private       static       string    GetIdentityToken    var    client      new       OAuth2Client    oauth2Address  var    response   clientRequestAccessTokenUserName     bob    ,     abc 123    ,    Constants   Realm  return    responseAccessToken    private       static       Identity    CallService    string    swt    var    client      new       HttpClient      BaseAddress   _baseAddress   clientDefaultRequestHeadersAuthorization      new       AuthenticationHeaderValue        Bearer    , swt  var    response   clientGetAsync     identity     Result  responseEnsureSuccessStatusCode  return    responseContentReadAsAsync Result    So you can see that it s pretty straightforward to implement various authentication scenarios using WebAPI and my authentication library Stay tuned for more client samples   IMAGE  </description><link>http://www.secuobs.com/revue/news/363418.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/363418.shtml</guid></item>
<item><title>ASPNET WebAPI Security 3  Extensible Authentication Framework</title><description>Secuobs.com : 2012-03-13 16:46:20 - www.leastprivilege.com -    In my last post, I described the identity architecture of ASPNET Web API The short version was, that Web API  beta 1  does not really have an authentication system on its own, but inherits the client security context from its host This is fine in many situations  eg AJAX style callbacks with an already established logon session  But there are many cases where you don t use the containing web application for authentication, but need to do it yourself Examples of that would be token based authentication and clients that don t run in the context of the web application  eg desktop clients   mobile  Since Web API provides a nice extensibility model, it is easy to implement whatever security framework you want on top of it My design goals were     Easy to use    Extensible    Claims-based and of course, this should always behave the same, regardless of the hosting environment In the rest of the post I am outlining some of the bits and pieces, So you know what you are dealing with, in case you want to try the code At the very heart  is a so called message handler This is a Web API extensibility point that gets to see  and modify if needed  all incoming and outgoing requests Handlers run after the conversion from host to Web API, which means that handler code deals with HttpRequestMessage and HttpResponseMessage See Pedro s post for more information on the processing pipeline This handler requires a configuration object for initialization Currently this is very simple, it contains     Settings for the various authentication and credential types    Settings for claims transformation    Ability to block identity inheritance from host The most important part here is the credential type support, but I will come back to that later The logic of the message handler is simple  1  Look at the incoming request 2  If the request contains an authorization header, try to authenticate the client 1  If this is successful, create a claims principal and populate the usual places 2  If not, return a 401 status code and set the Www-Authenticate header 3  Look at outgoing response, if the status code is 401, set the Www-Authenticate header Credential type support Under the covers I use the WIF security token handler infrastructure to validate credentials and to turn security tokens into claims The idea is simple  an authorization header consists of two pieces  the schema and the actual  token  My configuration object allows to associate a security token handler with a scheme This way you only need to implement support for a specific credential type, and map that to the incoming scheme value The current version supports HTTP Basic Authentication as well as SAML and SWT tokens  I needed to do some surgery on the standard security token handlers, since WIF does not directly support string-ified tokens The next version of NET will fix that, and the code should become simpler then  You can eg use this code to hook up a username password handler to the Basic scheme  the default scheme name for Basic Authentication  configHandlerAddBasicAuthenticationHandler   username, password    username   password   You simply have to provide a password validation function which could of course point back to your existing password library or eg membership The following code maps a token handler for Simple Web Tokens  SWT  to the Bearer scheme  the currently favoured scheme name for OAuth2  You simply have to specify the issuer name, realm and shared signature key  configHandlerAddSimpleWebTokenHandler   Bearer    , http identitythinktecturecom trust   , Constants   Realm,  Dc9Mpi3jaaaUpBQpa 4R7XtUsa3D ALSjTVvK8IUZbg      For certain integration scenarios it is very useful if your Web API can consume SAML tokens This is also easily accomplishable The following code uses the standard WIF API to configure the usual SAMLisms like issuer, audience, service certificate and certificate validation Both SAML 11 and 20 are supported var    registry      new       ConfigurationBasedIssuerNameRegistry     registryAddTrustedIssuer   d1 c5 b1 25 97 d0 36 94 65 1c e2 64 fe 48 06 01 35 f7 bd db    ,     ADFS      var    adfsConfig      new       SecurityTokenHandlerConfiguration     adfsConfigAudienceRestrictionAllowedAudienceUrisAdd  new       Uri       Constants   Realm  adfsConfigIssuerNameRegistry   registry  adfsConfigCertificateValidator      X509CertificateValidator   None    token decryption  read from configuration section  adfsConfigServiceTokenResolver    FederatedAuthentication   ServiceConfigurationCreateAggregateTokenResolver  configHandlerAddSaml11SecurityTokenHandler     SAML    , adfsConfig  Claims Transformation After successful authentication, if configured, the standard WIF ClaimsAuthenticationManager is called to run claims transformation and validation logic This stage is used to transform the  technical  claims from the security token into application claims You can either have a separate transformation logic, or share on eg with the containing web application That s just a matter of configuration Adding the authentication handler to a Web API application In the spirit of Web API this is done in code, eg globalasax for web hosting  protected       void    Application_Start    AreaRegistration   RegisterAllAreas  ConfigureApis    GlobalConfiguration   Configuration  RegisterGlobalFilters    GlobalFilters   Filters  RegisterRoutes    RouteTable   Routes  BundleTable   BundlesRegisterTemplateBundles    private       void    ConfigureApis    HttpConfiguration    configuration    configurationMessageHandlersAdd  new       AuthenticationHandler    ConfigureAuthentication    private       AuthenticationConfiguration    ConfigureAuthentication    var    config      new       AuthenticationConfiguration     sample claims transformation for consultants sample, comment out to see raw claims ClaimsAuthenticationManager      new       ApiClaimsTransformer    ,   value of the www-authenticate header,    if not set, the first scheme added to the handler collection is used DefaultAuthenticationScheme       Basic      add token handlers - see above return    config    You can find the full source code and some samples here In the next post I will describe some of the samples in the download, and then move on to authorization HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/363218.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/363218.shtml</guid></item>
<item><title>ASPNET WebAPI Security 2  Identity Architecture</title><description>Secuobs.com : 2012-03-08 14:13:53 - www.leastprivilege.com -    Pedro has beaten me to the punch with a detailed post  and diagram  about the WebAPI hosting architecture So go read his post first, then come back so we can have a closer look at what that means for security The first important takeaway is that WebAPI is hosting independent- currently it ships with two host integration implementations   one for ASPNET  aka web host  and WCF  aka self host  Pedro nicely shows the integration into the web host Self hosting is not done yet so we will mainly focus on the web hosting case and I will point out security related differences when they exist The interesting part for security  amongst other things of course  is the HttpControllerHandler  see Pedro s diagram    this is where the host specific representation of an HTTP request gets converted to the WebAPI abstraction  called HttpRequestMessage  The ConvertRequest method does the following     Create a new HttpRequestMessage    Copy URI, method and headers from the HttpContext    Copies HttpContextUser to the Properties dictionary on the HttpRequestMessage The key used for that can be found on HttpPropertyKeysUserPrincipalKey  which resolves to  MS_UserPrincipal  So the consequence is that WebAPI receives whatever IPrincipal has been set by the ASPNET pipeline  in the web hosting case  Common questions are    Are there situations where is property does not get set  Not in ASPNET   the DefaultAuthenticationModule in the HTTP pipeline makes sure HttpContextUser  and ThreadCurrentPrincipal   more on that later  are always set Either to some authenticated user   or to an anonymous principal This may be different in other hosting environments  again more on that later    Why so generic  Keep in mind that WebAPI is hosting independent and may run on a host that materializes identity completely different compared to ASPNET  or NET in general  This gives them a way to evolve the system in the future   How does WebAPI code retrieve the current client identity  HttpRequestMessage has an extension method called GetUserPrincipal  which returns the property as an IPrincipal A quick look at self hosting shows that the moral equivalent of HttpControllerHandlerConvertRequest  is HttpSelfHostServerProcessRequestContext  Here the principal property gets only set when the host is configured for Windows authentication  inconsisteny  Do I like that  Well   yes and no Here are my thoughts     I like that it is very straightforward to let WebAPI inherit the client identity context of the host    This might not always be what you want   think of an ASPNET app that consists of UI and APIs   the UI might use Forms authentication, the APIs token based authentication So it would be good if the two parts would live in a separate security world    It makes total sense to have this generic hand off point for identity between the host and WebAPI    It also makes total sense for WebAPI plumbing code  especially handlers  to use the WebAPI specific identity abstraction    But   c mon we are running on NET And the way NET represents identity is via IPrincipal IIdentity That s what every NET developer on this planet is used to So I would like to see a User property of type IPrincipal on ApiController    I don t like the fact that ThreadCurrentPrincipal is not populated TCP is a well established pattern as a one stop shop to retrieve client identity on NET That makes a lot of sense   even if the name is misleading at best    There might be existing library code you want to call from WebAPI that makes use of TCP  eg PrincipalPermission, or a simple Name or IsInRole     Having the client identity as an ambient property is useful for code that does not have access to the current HTTP request  for calling GetUserPrincipal     I don t like the fact that that the client identity conversion from host to WebAPI is inconsistent This makes writing security plumbing code harder I think the logic should always be     If the host has a client identity representation, copy it    If not, set an anonymous principal on the request message Btw   please don t annoy me with the  but TCP is static, and static is bad for testing  chant TCP is a getter setter and, in fact I find it beneficial to be able to set different security contexts in unit tests before calling in some logic And, in case you have wondered   TCP is indeed thread static  and the name comes from a time where a logical operation was bound to a thread   which is not true anymore  But all thread creation APIs in NET actually copy TCP to the new thread they create This is the case since NET 20 and is certainly an improvement compared to how Win32 does things So to sum it up     The host plumbing copies the host client identity to WebAPI  this is not perfect yet, but will surely be improved     or in other words  The current WebAPI bits don t ship with any authentication plumbing, but solely use whatever authentication  and thus client identity  is set up by the host    WebAPI developers can retrieve the client identity from the HttpRequestMessage    Hopefully my proposed changes around TCP and the User property on ApiController will be added In the next post, I will detail how to add WebAPI specific authentication support, eg for Basic Authentication and tokens This includes integrating the notion of claims based identity After that we will look at the built-in authorization bits and how to improve them as well Stay tuned  IMAGE  </description><link>http://www.secuobs.com/revue/news/362205.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/362205.shtml</guid></item>
<item><title>ASPNET WebAPI Security 1  Introducing ThinktectureIdentityModelHttp</title><description>Secuobs.com : 2012-03-07 09:05:17 - www.leastprivilege.com -    Over the course of the next posts I will describe the security options you have when writing services using the new ASPNET WebAPI Before I start digging into the gory details, all the sample code and concepts I will show are implemented in the newest incarnation of ThinktectureIdentityModel  https githubcom thinktecture ThinktectureIdentityModelHttp Stay tuned   IMAGE  </description><link>http://www.secuobs.com/revue/news/361882.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/361882.shtml</guid></item>
<item><title>ThinktectureIdentityModel  on GitHub</title><description>Secuobs.com : 2012-03-06 07:51:35 - www.leastprivilege.com -    I uploaded ThinkectureIdentityModel  core  and ThinktectureIdentityModelWeb  WCF Web Programing Model  to github I thought that s the easiest to make the source code available, especially for the stuff that is work in progress  IMAGE  </description><link>http://www.secuobs.com/revue/news/361614.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/361614.shtml</guid></item>
<item><title>Preview  Authentication Framework and Claims-based Identity for ASPNET WebApi</title><description>Secuobs.com : 2012-02-23 20:50:39 - www.leastprivilege.com -    I have moved this to the new ASPNET WebApi I am pretty happy with it  You can download the work in progress here  https githubcom leastprivilege ASPNET-WebApi-Security HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/359578.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/359578.shtml</guid></item>
<item><title>SharePoint Web Service, ADFS and StarterSTS IdentityServer</title><description>Secuobs.com : 2012-02-21 18:35:42 - www.leastprivilege.com -    Another nice piece from Sam  thanks  http wwwhuggillcom 2012 02 04 claims-proxy-a-c-sharp-library-for-calling-claims-protected-web-services IMAGE  </description><link>http://www.secuobs.com/revue/news/359045.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/359045.shtml</guid></item>
<item><title>IdentityServer v101 On-Premise and Azure Edition</title><description>Secuobs.com : 2012-02-17 15:12:56 - www.leastprivilege.com -    I just uploaded the final Azure Edition as well as a combined Azure and on-premise source package to Codeplex http identityservercodeplexcom releases I am also in the process of building a wiki for documentation   it is not done yet   but can be browsed here  http wikithinktecturecom IdentityServerMainPageashx Any feedback, bug reports, volunteers  coding, setup, wiki    please DM me Have fun   IMAGE  </description><link>http://www.secuobs.com/revue/news/358444.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/358444.shtml</guid></item>
<item><title>StarterSTS hits 10k downloads</title><description>Secuobs.com : 2012-02-17 15:12:56 - www.leastprivilege.com -    Thanks to all who downloaded, tested and improved StarterSTS We just hit 10k downloads  IMAGE  Now it is time to move on Please use IdentityServer from now on, as StarterSTS will not be maintained anymore Have fun   IMAGE  </description><link>http://www.secuobs.com/revue/news/358443.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/358443.shtml</guid></item>
<item><title>Web Apps vs Web Services  302s and 401s are not always good Friends</title><description>Secuobs.com : 2012-02-10 19:30:14 - www.leastprivilege.com -    It is not very uncommon to have web sites that have web UX and services content The UX part maybe uses WS-Federation  or some other redirect based mechanism  That means whenever an authorization error occurs  401 status code , this is picked by the corresponding redirect module and turned into a redirect  302  to the login page All is good But in services, when you emit a 401, you typically want that status code to travel back to the client agent, so it can do error handling These two approaches conflict If you think  like me  that you should separate UX and services into separate apps, you don t need to read on Just do it   If you need to mix both mechanisms in a single app   here s how I solved it for a project I sub classed the redirect module   this was in my case the WIF WS-Federation HTTP module and modified the OnAuthorizationFailed method In there I check for a special HttpContext item, and if that is present, I suppress the redirect Otherwise everything works as normal  class       ServiceAwareWSFederationAuthenticationModule         WSFederationAuthenticationModule   protected       override       void    OnAuthorizationFailed    AuthorizationFailedEventArgs    e    base   OnAuthorizationFailed e  var    isService      HttpContext   CurrentItems    AdvertiseWcfInHttpPipelineBehavior   DefaultLabel  if     isService      null       eRedirectToIdentityProvider      false           Now the question is, how do you smuggle that value into the HttpContext If it is a MVC based web service, that s easy of course In the case of WCF, one approach that worked for me was to set it in a service behavior  dispatch message inspector to be exact  public       void    BeforeSendReply  ref       Message    reply,    object    correlationState    if        HttpContext   Current      null       HttpContext   CurrentItems DefaultLabel       true         HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/357192.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/357192.shtml</guid></item>
<item><title>Replacing ASPNET Forms Authentication with WIF Session Authentication  for the better </title><description>Secuobs.com : 2012-02-09 22:27:41 - www.leastprivilege.com -    ASPNET Forms Authentication and WIF Session Authentication  which has  nothing  to do with ASPNET sessions  are very similar Both inspect incoming requests for a special cookie that contains identity information, if that cookie is present it gets validated and if that is successful, the identity information is made available to the application via HttpContextUser ThreadCurrentPrincipal The main difference between the two is the identity to cookie serialization engine that sits below Whereas ForsmAuth can only store the name of the user and an additional UserData string It is limited to a single cookie and hardcoded to protection via the machine key WIF session authentication in turn has these additional features     Can serialize a complete ClaimsPrincipal  including claims  to the cookie s     Has a cookie overflow mechanism when data gets too big In total it can create up to 8 cookies  á 4 KB  per domain  not that I would recommend round tripping that much data     Supports server side caching  which is an extensible mechanism     Has an extensible mechanism for protection  DPAPI by default, RSA as an option for web farms, and machine key based protection is coming in NET 45  So in other words   session authentication is the superior technology, and if done cleverly enough you can replace FormsAuth without any changes to your application code The only features missing is the redirect mechanism to a login page and an easy to use API to set authentication cookies But that s easy to add   FormsSessionAuthenticationModule This module is a sub class of the standard WIF session module, adding the following features     Handling EndRequest to do the redirect on 401s to the login page configured for FormsAuth    Reads the FormsAuth cookie name, cookie domain, timeout and require SSL settings to configure the module accordingly    Implements sliding expiration if configured for FormsAuth It also uses the same algorithm as FormsAuth to calculate when the cookie needs renewal    Implements caching of the principal on the server side  aka session mode  if configured in an AppSetting    Supports claims transformation via a ClaimsAuthenticationManager As you can see, the whole module is designed to easily replace the FormsAuth mechanism Simply set the authentication mode to None and register the module In the spirit of the FormsAuthentication class, there is also now a SessionAuthentication class with the same methods and signatures  eg SetAuthCookie and SignOut  The rest of your application code should not be affected In addition the session module looks for a HttpContext item called  NoRedirect  If that exists, the redirect to the login page will  not  happen, instead the 401 is passed back to the client Very useful if you are implementing services or web APIs where you want the actual status code to be preserved A corresponding UnauthorizedResult is provided that gives you easy access to the context item The download contains a sample app, the module and an inspector for session cookies and tokens Let s hope that in NET 45 such a module comes out of the box HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/357049.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/357049.shtml</guid></item>
<item><title>Mixing Forms and Token Authentication in a single ASPNET Application  the Details </title><description>Secuobs.com : 2012-02-02 09:07:14 - www.leastprivilege.com -    The scenario described in my last post works because of the design around HTTP modules in ASPNET Authentication related modules  like Forms authentication and WIF WS-Fed Sessions  typically subscribe to three events in the pipeline   AuthenticateRequest PostAuthenticateRequest for pre-processing and EndRequest for post-processing  like making redirects to a login page  In the pre-processing stage it is the modules  job to determine the identity of the client based on incoming HTTP details  like a header, cookie, form post  and set HttpContextUser and ThreadCurrentPrincipal The actual page  in the ExecuteHandler event   sees  the identity that the last module has set So in our case there are three modules in effect     FormsAuthenticationModule  AuthenticateRequest, EndRequest     WSFederationAuthenticationModule  AuthenticateRequest, PostAuthenticateRequest, EndRequest     SessionAuthenticationModule  AuthenticateRequest, PostAuthenticateRequest  So let s have a look at the different scenario we have when mixing Forms auth and WS-Federation Anoymous request to unprotected resource This is the easiest case Since there is no WIF session cookie or a FormsAuth cookie, these modules do nothing The WSFed module creates an anonymous ClaimsPrincipal and calls the registered ClaimsAuthenticationManager  if any  to transform it The result  by default an anonymous ClaimsPrincipal  gets set  IMAGE  Anonymous request to FormsAuth protected resource This is the scenario where an anonymous user tries to access a FormsAuth protected resource for the first time The principal is anonymous and before the page gets rendered, the Authorize attribute kicks in The attribute determines that the user needs authentication and therefor sets a 401 status code and ends the request Now execution jumps to the EndRequest event, where the FormsAuth module takes over The module then converts the 401 to a redirect  302  to the forms login page If authentication is successful, the login page sets the FormsAuth cookie  IMAGE  FormsAuth authenticated request to a FormsAuth protected resource Now a FormsAuth cookie is present, which gets validated by the FormsAuth module This cookie gets turned into a GenericPrincipal FormsIdentity combination The WS-Fed module turns the principal into a ClaimsPrincipal and calls the registered ClaimsAuthenticationManager The outcome of that gets set on the context  IMAGE  Anonymous request to STS protected resource This time the anonymous user tries to access an STS protected resource  a controller decorated with the RequireTokenAuthentication attribute  The attribute determines that the user needs STS authentication by checking the authentication type on the current principal If this is not Federation, the redirect to the STS will be made After successful authentication at the STS, the STS posts the token back to the application  using WS-Federation syntax   IMAGE  Postback from STS authentication After the postback, the WS-Fed module finds the token response and validates the contained token If successful, the token gets transformed by the ClaimsAuthenticationManager, and the outcome is a  stored in a session cookie, and b  set on the context  IMAGE  STS authenticated request to an STS protected resource This time the WIF Session authentication module kicks in because it can find the previously issued session cookie The module re-hydrates the ClaimsPrincipal from the cookie and sets it  IMAGE  FormsAuth and STS authenticated request to a protected resource This is kind of an odd case   eg the user first authenticated using Forms and after that using the STS This time the FormsAuth module does its work, and then afterwards the session module stomps over the context with the session principal In other words, the STS identity wins  IMAGE  What about roles  A common way to set roles in ASPNET is to use the role manager feature There is a corresponding HTTP module for that  RoleManagerModule  that handles PostAuthenticateRequest Does this collide with the above combinations  No it doesn t  When the WS-Fed module turns existing principals into a ClaimsPrincipal  like it did with the FormsIdentity , it also checks for RolePrincipal  which is the principal type created by role manager , and turns the roles in role claims Nice  But as you can see in the last scenario above, this might result in unnecessary work, so I would rather recommend consolidating all role work  and other claims transformations  into the ClaimsAuthenticationManager In there you can check for the authentication type of the incoming principal and act accordingly HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/355464.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/355464.shtml</guid></item>
<item><title>Mixing Forms and Token Authentication in a single ASPNET Application</title><description>Secuobs.com : 2012-02-02 06:19:28 - www.leastprivilege.com -    I recently had the task to find out how to mix ASPNET Forms Authentication with WIF s WS-Federation The FormsAuth app did already exist, and a new sub-directory of this application should use ADFS for authentication Minimum changes to the existing application code would be a plus   Since the application is using ASPNET MVC this was quite easy to accomplish   WebForms would be a little harder, but still doable I will discuss the MVC solution here To solve this problem, I made the following changes to the standard MVC internet application template     Added WIF s WSFederationAuthenticationModule and SessionAuthenticationModule to the modules section    Add a WIF configuration section to configure the trust with ADFS    Added a new authorization attribute This attribute will go on controller that demand ADFS  or STS in general  authentication The attribute logic is quite simple   it checks for authenticated users   and additionally that the authentication type is set to Federation If that s the case all is good, if not, the redirect to the STS will be triggered public       class       RequireTokenAuthenticationAttribute         AuthorizeAttribute   protected       override       bool    AuthorizeCore    HttpContextBase    httpContext    if     httpContextUserIdentityIsAuthenticated   httpContextUserIdentityAuthenticationTypeEquals  WIF   AuthenticationTypes   Federation,    StringComparison   OrdinalIgnoreCase    return       true       return       false       protected       override       void    HandleUnauthorizedRequest    AuthorizationContext    filterContext                  do the redirect to the STS var    message      FederatedAuthentication   WSFederationAuthenticationModuleCreateSignInRequest   passive    ,  filterContextHttpContextRequestRawUrl,  false     filterContextResult      new       RedirectResult    messageRequestUrl      That s it   If you want to know why this works  and a possible gotcha    read my next post  IMAGE  </description><link>http://www.secuobs.com/revue/news/355449.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/355449.shtml</guid></item>
<item><title>Thinktecture IdentityServer Azure Edition RC</title><description>Secuobs.com : 2012-01-27 10:59:20 - www.leastprivilege.com -    I found some time over the holidays to finalize the Azure edition of IdentityServer http identityservercodeplexcom releases view 81206 The biggest difference to the on-premise version  and earlier Azure betas  is, that by default IdSrv now uses Azure Storage for all data storage  configuration   user data  This means that there is no need anymore for SQL Azure  which is still supported out of the box   just not the default anymore  The download includes a readme file with setup instructions In a nutshell     Create a new hosted service and upload your certificates    Modify the service configuration file in the download to your needs  signing cert, connection strings to storage     Deploy the package via the portal or other tools    Use the new Powershell scripts to add users If you encounter any problem, please give me feedback  IMAGE  </description><link>http://www.secuobs.com/revue/news/354389.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/354389.shtml</guid></item>
<item><title>Google Apps and IdentityServer</title><description>Secuobs.com : 2012-01-16 09:20:39 - www.leastprivilege.com -    nice   IMAGE  </description><link>http://www.secuobs.com/revue/news/352233.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/352233.shtml</guid></item>
<item><title>Troopers 2012</title><description>Secuobs.com : 2011-12-31 12:39:00 - www.leastprivilege.com -    My last advice for 2011  Get a ticket for Troopers 2012 before it is sold out If you like to learn about IPv6, Android, iOS, SAP or cloud security  and much more    that s the place to be   IMAGE  </description><link>http://www.secuobs.com/revue/news/349704.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/349704.shtml</guid></item>
<item><title>Walkthrough for setting up IdentityServer v10</title><description>Secuobs.com : 2011-12-21 10:57:49 - www.leastprivilege.com -    Claudio Sanchez did it again  thanks  http claudioasanchezblogspotcom 2011 12 walk-though-of-provisioning-identityhtml  IMAGE  </description><link>http://www.secuobs.com/revue/news/348379.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/348379.shtml</guid></item>
<item><title>ACS for free til December 2012</title><description>Secuobs.com : 2011-12-21 10:57:49 - www.leastprivilege.com -    see here  http blogsmsdncom b windowsazure archive 2011 12 20 important-announcements-regarding-the-access-control-serviceaspx  IMAGE  </description><link>http://www.secuobs.com/revue/news/348378.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/348378.shtml</guid></item>
<item><title>Claims Guide2nd Edition PDF</title><description>Secuobs.com : 2011-12-12 06:17:52 - www.leastprivilege.com -    http tinyurlcom claimsguide2  IMAGE  </description><link>http://www.secuobs.com/revue/news/346579.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/346579.shtml</guid></item>
<item><title>Small  and fixed  Bug in IdentityServer v10</title><description>Secuobs.com : 2011-12-07 09:24:42 - www.leastprivilege.com -    It was brought to my attention that fedutil does not work anymore with IdSrv v1 metadata And I can confirm that The reason for this bug is my recent change to the XmlWriter factory methods which have a different default behavior when it comes to encoding Since there were only 20 downloads so far   I fixed the bug in-place  shame on me  So when you are one of the early adopters and run into this problem   just re-download IdSrv   HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/345786.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/345786.shtml</guid></item>
<item><title>Thinktecture IdentityServer v10</title><description>Secuobs.com : 2011-12-06 20:01:32 - www.leastprivilege.com -    Yeah   it is finally done I just uploaded the v1 bits to Codeplex and the documentation to our server Here s the official blurb  Thinktecture IdentityServer is an open source security token service based on Microsoft NET, ASPNET MVC, WCF and WIF High level features    Multiple protocols support  WS-Trust, WS-Federation, OAuth2, WRAP, JSNotify, HTTP GET     Multiple token support  SAML 11 20, SWT     Out of the box integration with ASPNET membership, roles and profile    Support for username password and client certificates authentication    Support for WS-Federation metadata    Support for WS-Trust identity delegation    Extensibility points to customize configuration and user management handling  IMAGE  Disclaimer I did thorough testing of all features of IdentityServer - but keep in mind that this is an open source project and I am the only architect, developer and tester on the team IdentityServer also lacks many of the enterprise-level features like configuration services, proxy support, operations integration etc I only recommend using IdentityServer if you also understand how it works  to be able to support it  I am offering consulting to help you with customization and lock down - contact me Download Documentation Up next is v1 of the Azure version Have fun   IMAGE  </description><link>http://www.secuobs.com/revue/news/345668.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/345668.shtml</guid></item>
<item><title>StarterSTS on IIS 6</title><description>Secuobs.com : 2011-11-23 17:01:21 - www.leastprivilege.com -    Sam Huggill wrote a great post on how to get StarterSTS working on IIS 6 Thanks Sam   IMAGE  </description><link>http://www.secuobs.com/revue/news/342238.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/342238.shtml</guid></item>
<item><title>Token based Authentication for WCF HTTP REST Services  Authorization</title><description>Secuobs.com : 2011-11-16 09:46:11 - www.leastprivilege.com -    In the previous post I showed how token based authentication can be implemented for WCF HTTP based services Authentication is the process of finding out who the user is   this includes anonymous users Then it is up to the service to decide under which circumstances the client has access to the service as a whole or individual operations This is called authorization By default   my framework does not allow anonymous users and will deny access right in the service authorization manager You can however turn anonymous access on   that means technically, that instead of denying access, an anonymous principal is placed on ThreadCurrentPrincipal You can flip that switch in the configuration class that you can pass into the service host factory var    configuration      new       WebTokenWebServiceHostConfiguration   AllowAnonymousAccess      true    But this is not enough, in addition you also need to decorate the individual operations to allow anonymous access as well, eg      AllowAnonymousAccess     public       string    GetInfo           Inside these operations you might have an authenticated or an anonymous principal on ThreadCurrentPrincipal, and it is up to your code to decide what to do Side note  Being a security guy, I like this opt-in approach to anonymous access much better that all those opt-out approaches out there  like the Authorize attribute   or this  Claims-based Authorization Since there is a ClaimsPrincipal available, you can use the standard WIF claims authorization manager infrastructure   either declaratively via ClaimsPrincipalPermission or programmatically  see also here      ClaimsPrincipalPermission       SecurityAction   Demand,  Resource       Claims    , Operation       View      public       ViewClaims    GetClientIdentity    return       new       ServiceLogic    GetClaims    In addition you can also turn off per-request authorization  see here for background  via the config and just use the  domain specific  instrumentation While the code is not 100pourcents done   you can download the current solution here HTH  Wanna learn more about federation, WIF, claims, tokens etc  Click here   IMAGE  </description><link>http://www.secuobs.com/revue/news/340935.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/340935.shtml</guid></item>
<item><title>Token based Authentication for WCF HTTP REST Services  The Client</title><description>Secuobs.com : 2011-11-15 18:33:50 - www.leastprivilege.com -    If you wondered how a client would have to look like to work with the authentication framework, it is pretty straightfoward  1  Request a token 2  Put that token on the authorization header  along with a registered scheme  and make the service call eg  var    oauth2      new       OAuth2Client    oauth2Address  var    swt   oauth2RequestAccessToken   username    ,     password    , _baseAddressAbsoluteUri  var    client      new       HttpClient      BaseAddress   _baseAddress   clientDefaultRequestHeadersAuthorization    new       AuthenticationHeaderValue        Bearer    , swt   var    response   clientGet     identity      responseEnsureSuccessStatusCode  HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/340799.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/340799.shtml</guid></item>
<item><title>Token based Authentication for WCF HTTP REST Services  Authentication</title><description>Secuobs.com : 2011-11-15 17:42:05 - www.leastprivilege.com -    This post shows some of the implementation techniques for adding token and claims based security to HTTP REST services written with WCF For the theoretical background, see my previous post Disclaimer The framework I am using building here is not the only possible approach to tackle the problem Based on customer feedback and requirements the code has gone through several iterations to a point where we think it is ready to handle most of the situations Goals and requirements    The framework should be able to handle typical scenarios like username password based authentication, as well as token based authentication    The framework should allow adding new supported token types    Should work with WCF web programming model either self-host or IIS hosted    Service code can rely on an IClaimsPrincipal on ThreadCurrentPrincipal that describes the client using claims-based identity Implementation overview In WCF the main extensibility point for this kind of security work is the ServiceAuthorizationManager It gets invoked early enough in the pipeline, has access to the HTTP protocol details of the incoming request and can set ThreadCurrentPrincipal The job of the SAM is simple  1  Check the Authorization header of the incoming HTTP request 2  Check if a  registered  token  more on that later  is present 3  If yes, validate the token using a security token handler, create the claims principal  including claims transformation  and set ThreadCurrentPrincipal 4  If no, set an anonymous principal on ThreadCurrentPrincipal By default, anonymous principals are denied access   so the request ends here with a 401  more on that later  To wire up the custom authorization manager you need a custom service host   which in turn needs a custom service host factory The full object model looks like this   IMAGE  Token handling A nice piece of existing WIF infrastructure are security token handlers Their job is to serialize a received security token into a CLR representation, validate the token and turn the token into claims The way this works with WS-Security based services is that WIF passes the name namespace of the incoming token to WIF s security token handler collection This in turn finds out which token handler can deal with the token and returns the right instances For HTTP based services we can do something very similar The scheme on the Authorization header gives the service a hint how to deal with an incoming token So the only missing link is a way to associate a token handler  or multiple token handlers  with a scheme and we are  almost  done WIF already includes token handler for a variety of tokens like username password or SAML 11 20 The accompanying sample has a implementation for a Simple Web Token  SWT  token handler, and as soon as JSON Web Token are ready, simply adding a corresponding token handler will add support for this token type, too All supported schemes token types are organized in a WebSecurityTokenHandlerCollectionManager and passed into the host factory host authorization manager Adding support for basic authentication against a membership provider would eg look like this  in globalasax  var    manager      new       WebSecurityTokenHandlerCollectionManager     managerAddBasicAuthenticationHandler username, password     Membership   ValidateUser username, password  Adding support for Simple Web Tokens with a scheme of Bearer  the current OAuth2 scheme  requires passing in a issuer, audience and signature verification key  managerAddSimpleWebTokenHandler   Bearer    ,  http identityserverthinktecturecom trust initial    ,  https roadie webservicesecurity rest    ,  WFD7i8XRHsrUPEdwSisdHoHy08W3lM16Bk6SCT8ht6A      In some situations, SAML token may be used as well The following configures SAML support for a token coming from ADFS2  var    registry      new       ConfigurationBasedIssuerNameRegistry     registryAddTrustedIssuer   d1 c5 b1 25 97 d0 36 94 65 1c e2 64 fe 48 06 01 35 f7 bd db    ,     ADFS         var    adfsConfig      new       SecurityTokenHandlerConfiguration     adfsConfigAudienceRestrictionAllowedAudienceUrisAdd  new       Uri        https roadie webservicesecurity rest      adfsConfigIssuerNameRegistry   registry  adfsConfigCertificateValidator      X509CertificateValidator   None       token decryption  read from config        adfsConfigServiceTokenResolver    IdentityModelConfiguration   ServiceConfigurationCreateAggregateTokenResolver               managerAddSaml11SecurityTokenHandler     SAML    , adfsConfig  Transformation The custom authorization manager will also try to invoke a configured claims authentication manager This means that the standard WIF claims transformation logic can be used here as well And even better, can be also shared with eg a  surrounding  web application Error handling A WCF error handler takes care of turning  access denied  faults into 401 status codes and a message inspector adds the registered authentication schemes to the outgoing WWW-Authenticate header when a 401 occurs The next post will conclude with authorization as well as the source code download  Wanna learn more about federation, WIF, claims, tokens etc  Click here   IMAGE  </description><link>http://www.secuobs.com/revue/news/340780.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/340780.shtml</guid></item>
<item><title>Token based Authentication and Claims for Restful Services</title><description>Secuobs.com : 2011-11-15 10:39:31 - www.leastprivilege.com -    WIF as it exists today is optimized for web applications  passive WS-Federation  and SOAP based services  active WS-Trust  While there is limited support for WCF WebServiceHost based services  for standard credential types like Windows and Basic , there is no ready to use plumbing for RESTful services that do authentication based on tokens This is not an oversight from the WIF team, but the REST services security world is currently rapidly changing   and that s by design There are a number of intermediate solutions, emerging protocols and token types, as well as some already deprecated ones So it didn t make sense to bake that into the core feature set of WIF But after all, the F in WIF stands for Foundation So just like the WIF APIs integrate tokens and claims into other hosts, this is also  easily  possible with RESTful services Here s how HTTP Services and Authentication Unlike SOAP services, in the REST world there is no  over  specified security framework like WS-Security Instead standard HTTP means are used to transmit credentials and SSL is used to secure the transport and data in transit For most cases the HTTP Authorize header is used to transmit the security token  this can be as simple as a username password up to issued tokens of some sort  The Authorize header consists of the actual credential  consider this opaque from a transport perspective  as well as a scheme The scheme is some string that gives the service a hint what type of credential was used  eg Basic for basic authentication credentials  HTTP also includes a way to advertise the right credential type back to the client, for this the WWW-Authenticate response header is used  IMAGE  So for token based authentication, the service would simply need to read the incoming Authorization header, extract the token, parse and validate it After the token has been validated, you also typically want some sort of client identity representation based on the incoming token This is regardless of how technology-wise the actual service was built In ASPNET  MVC  you could use an HttpModule or an ActionFilter In  todays  WCF, you would use the ServiceAuthorizationManager infrastructure The nice thing about using WCF  native extensibility points is that you get self-hosting for free This is where WIF comes into play WIF has ready to use infrastructure built-in that just need to be plugged into the corresponding hosting environment     Representation of identity based on claims This is a very natural way of translating a security token  and again I mean this in the widest sense   could be also a username password  into something our applications can work with    Infrastructure to convert tokens into claims  called security token handler     Claims transformation    Claims-based authorization So much for the theory In the next post I will show you how to implement that for WCF   including full source code and samples  Wanna learn more about federation, WIF, claims, tokens etc  Click here   IMAGE  </description><link>http://www.secuobs.com/revue/news/340690.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/340690.shtml</guid></item>
<item><title>Need WIF Training </title><description>Secuobs.com : 2011-11-09 09:35:27 - www.leastprivilege.com -    I spend numerous hours every month answering questions about WIF and identity in general This made me realize that this is still quite a complicated topic once you go beyond the standard fedutil stuff My good friend Brock and I put together a two day training course about WIF that covers everything we think is important The course includes extensive lab material where you take standard application and apply all kinds of claims and federation techniques and technologies like WS-Federation, WS-Trust, session management, delegation, home realm discovery, multiple identity providers, Access Control Service, REST, SWT and OAuth The lab also includes the latest version of the thinktecture identityserver and you will learn how to use and customize it If you are looking for an open enrollment style of training, have a look here Or contact me directly  The course outline looks as follows  Day 1 Intro to Claims-based Identity   the Windows Identity Foundation WIF introduces important concepts like conversion of security tokens and credentials to claims, claims transformation and claims-based authorization In this module you will learn the basics of the WIF programming model and how WIF integrates into existing NET code Externalizing Authentication for Web Applications WIF includes support for the WS-Federation protocol This protocol allows separating business and authentication logic into separate  distributed  applications The authentication part is called identity provider or in more general terms - a security token service This module looks at this scenario both from an application and identity provider point of view and walks you through the necessary concepts to centralize application login logic both using a standard product like Active Directory Federation Services as well as a custom token service using WIF s API support Externalizing Authentication for SOAP Services One big benefit of WIF is that it unifies the security programming model for ASPNET and WCF In the spirit of the preceding modules, we will have a look at how WIF integrates into the  SOAP  web service world You will learn how to separate authentication into a separate service using the WS-Trust protocol and how WIF can simplify the WCF security model and extensibility API Day 2 Advanced Topics  Security Token Service Architecture, Delegation and Federation The preceding modules covered the 80 20 cases of WIF in combination with ASPNET and WCF In many scenarios this is just the tip of the iceberg Especially when two business partners decide to federate, you usually have to deal with multiple token services and their implications in application design Identity delegation is a feature that allows transporting the client identity over a chain of service invocations to make authorization decisions over multiple hops In addition you will learn about the principal architecture of a STS, how to customize the one that comes with this training course, as well as how to build your own Outsourcing Authentication  Windows Azure   the Azure AppFabric Access Control Service Microsoft provides a multi-tenant security token service as part of the Azure platform cloud offering This is an interesting product because it allows to outsource vital infrastructure services to a managed environment that guarantees uptime and scalability Another advantage of the Access Control Service is, that it allows easy integration of both the  enterprise  protocols like WS-  as well as  web identities  like LiveID, Google or Facebook into your applications ACS acts as a protocol bridge in this case where the application developer doesn t need to implement all these protocols, but simply uses a service to make it happen Claims   Federation for the Web and Mobile World Also the web   mobile world moves to a token and claims-based model While the mechanics are almost identical, other protocols and token types are used to achieve better HTTP  REST  and JavaScript integration for in-browser applications and small footprint devices Also patterns like how to allow third party applications to work with your data without having to disclose your credentials are important concepts in these application types The nice thing about WIF and its powerful base APIs and abstractions is that it can shield application logic from these details while you can focus on implementing the actual application HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/339667.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/339667.shtml</guid></item>
<item><title>Fiddling with ADFS Traffic</title><description>Secuobs.com : 2011-11-06 13:18:07 - www.leastprivilege.com -    ADFS uses SSL extended protection which made observing traffic with Fiddler harder to impossible Fortunately, this can be fixed   Eric Lawrence writes about it here  IMAGE  </description><link>http://www.secuobs.com/revue/news/339102.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/339102.shtml</guid></item>
<item><title>Updated IdentityServer Sample Relying Party</title><description>Secuobs.com : 2011-11-02 19:57:06 - www.leastprivilege.com -    I just uploaded a new version of the sample relying party The three changes are     Added a session token diagnostics page This allows to look at cookie sizes, details and the raw contents    Sample code to switch to session mode    Sample code to implement sliding expiration This was already included since 10     WS-Federation example    Claims viewer    Token viewer    Active sign in via WS-Trust    Delegation HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/338419.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/338419.shtml</guid></item>
<item><title>Switching to WIF SessionMode in ASPNET</title><description>Secuobs.com : 2011-11-02 17:30:02 - www.leastprivilege.com -    To make it short  to switch to SessionMode  cache to server  in ASPNET, you need to handle an event and set a property Sounds easy   but you need to set it in the right place The most popular blog post about this topic is from Vittorio He advises to set IsSessionMode in WSFederationAuthenticationModule_SessionSecurityTokenCreated Now there were some open questions on forum, like this one So I decided to try it myself   and indeed it didn t work for me as well So I digged a little deeper, and after some trial and error I found the right place  in globalasax  void    WSFederationAuthenticationModule_SecurityTokenValidated  object    sender,    SecurityTokenValidatedEventArgs    e    FederatedAuthentication   SessionAuthenticationModuleIsSessionMode      true        Not sure if anything has changed since Vittorio s post   but this worked for me While playing around, I also wrote a little diagnostics tool that allows you to look into the session cookie  for educational purposes  Will post that soon HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/338386.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/338386.shtml</guid></item>
<item><title>Guide to Claims-based Identity and Access Control  2nd Edition </title><description>Secuobs.com : 2011-10-28 10:12:28 - www.leastprivilege.com -    This fell through the cracks over the summer holiday time  The 2nd edition of the Patterns   Practices  claims guide  has been released This is excellent  We added a lot of content around ADFS, Access Control Service, REST and SharePoint All source code is available as well  Grab it from  http msdnmicrosoftcom en-us library ff423674aspx Or use my vanity URL  http tinyurlcom claimsguide  IMAGE  </description><link>http://www.secuobs.com/revue/news/337411.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/337411.shtml</guid></item>
<item><title>IdentityServer and SharePoint Walkthrough</title><description>Secuobs.com : 2011-10-24 16:59:51 - www.leastprivilege.com -    Brian has posted a great walkthrough on how to setup idsrv in conjunction with SharePoint Thanks  http sharepintblogcom 2011 10 23 sharepoint-claims-based-authentication-with-thinktecture-identity-server-walkthrough   IMAGE  </description><link>http://www.secuobs.com/revue/news/336553.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/336553.shtml</guid></item>
<item><title>ThinktectureIdentityServer RC</title><description>Secuobs.com : 2011-10-21 09:27:34 - www.leastprivilege.com -    I just uploaded the RC of IdentityServer to Codeplex This release is feature complete and if I don t get any bug reports this is also pretty much the final V1 Changes from B1    The configuration data access is now based on EF 41 code first This makes it much easier to use different data stores For RTM I will also provide a SQL script for SQL Server so you can move the configuration to a separate machine  eg for load balancing scenarios     I included the ASPNET Universal Providers in the download This adds official support for SQL Azure, SQL Server and SQL Compact for the membership, roles and profile features Unfortunately the Universal Provider use a different schema than the original ASPNET providers  that sucks btw    so I made them optional If you want to use them go to webconfig and uncomment the new provider    The relying party registration entries now have added fields to add extra data that you want to couple with the RP One use case could be to give the UI a hint how the login experience should look like per RP This allows to have a different look and feel for different relying parties I also included a small helper API that you can use to retrieve the RP record based on the incoming WS-Federation query string    WS-Federation single sign out is now conforming to the spec    Certificate based endpoint identities for SSL endpoints are optional now    Added a initial configuration  wizard  This sets up the signing certificate, issuer URI and site title on the first run Installation This is still a  developer  release   that means it ships with source code that you have to build it etc But from that point it should be a little more straightforward as it used to be     Make sure SSL is configured correctly for IIS    Map the WebSite directory to a vdir in IIS    Run the web site This should bring up the initial configuration    Make sure the worker process account has access to the signing certificate private key    Make sure all your users are in the  IdentityServerUsers  role in your role store Administrators need the  IdentityServerAdministrators  role That should be it A proper documentation will be hopefully available soon  any volunteers  Please provide feedback  thanks   IMAGE  </description><link>http://www.secuobs.com/revue/news/336136.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/336136.shtml</guid></item>
<item><title>Roadmap for Thinktecture IdentityServer</title><description>Secuobs.com : 2011-10-06 19:01:20 - www.leastprivilege.com -    I got asked today if I could publish a roadmap for thinktecture IdentityServer  idrsv in short  Well   I got a lot of feedback after B1 and one of the biggest points here was the data access layer So I made two changes     I moved to configuration database access code to EF 41 code first That makes it much easier to change the underlying database So it is now just a matter of changing the connection string to use real SQL Server instead of SQL Compact Important when you plan to do scale out    I included the ASPNET Universal Providers in the download This adds official support for SQL Azure, SQL Server and SQL Compact for the membership, roles and profile features Unfortunately the Universal Provider use a different schema than the original ASPNET providers  that sucks btw    so I made them optional If you want to use them go to webconfig and uncomment the new provider Then there are some other small changes     The relying party registration entries now have added fields to add extra data that you want to couple with the RP One use case could be to give the UI a hint how the login experience should look like per RP This allows to have a different look and feel for different relying parties I also included a small helper API that you can use to retrieve the RP record based on the incoming WS-Federation query string    WS-Federation single sign out is now conforming to the spec    I made certificate based endpoint identities for SSL endpoints optional This caused some problems with configuration and versioning of existing clients I hope I can release the RC in the next days If there are no major issues, there will be RTM very soon   IMAGE  </description><link>http://www.secuobs.com/revue/news/333134.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/333134.shtml</guid></item>
<item><title>IdentityServer Installation Walkthrough</title><description>Secuobs.com : 2011-09-30 01:17:02 - www.leastprivilege.com -    Claudio Sanchez has created a little walkthrough for installing IdentityServer While he uses B1 refresh, I anticipate no changes for RTM  which is sitting here on my hard almost ready for publishing  Thanks Claudio   IMAGE  </description><link>http://www.secuobs.com/revue/news/331842.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/331842.shtml</guid></item>
<item><title>WIF in NET 45First Observations  2 </title><description>Secuobs.com : 2011-09-20 14:41:02 - www.leastprivilege.com -         WindowsIdentity, FormsIdentity and GenericIdentity now derive from ClaimsIdentity    WindowsIdentityGetCurrent  converts Windows token details  groups for the current Windows versions  to claims    Claims for Windows identities now distinguish between user claims and device claims  Windows 8 feature     WCF now populates ThreadCurrentPrincipal with a ClaimsPrincipal derived type  IMAGE  </description><link>http://www.secuobs.com/revue/news/329899.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/329899.shtml</guid></item>
<item><title>WIF in NET 45First Observations</title><description>Secuobs.com : 2011-09-20 04:42:26 - www.leastprivilege.com -         SystemSecurityClaims has ClaimsIdentity   ClaimsPrincipal    IClaimsIdentity   IClaimsPrincipal are gone The classes implement IIdentity   IPrincipal now directly    All the token handler and low level plumbing is now in SystemIdentityModel  IMAGE  </description><link>http://www.secuobs.com/revue/news/329793.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/329793.shtml</guid></item>
<item><title>Claims-based Identity in NET 45 and Windows 8</title><description>Secuobs.com : 2011-09-17 09:13:47 - www.leastprivilege.com -    There was not a ton of new information about WIF and related technologies at Build, but Samuel Devasahayam did a great talk about claims-based access control that contained some very interesting bits of information with regards to future directions From his slides  Windows 8    Bring existing identity claims model into the Windows platform    Domain controller issues groups   claims    Claims  user and device  sourced from identity attributes in AD    Claims delivered in Kerberos PAC    NT Token has a new claims section    Enhanced SDDL API s to work with claims    Enhanced user mode CheckAccess API s to work with claims    New ACL-UX    Target audits with claims-based expressions WIF   NET 45    WIF is in the box with NET Framework 45    Every principal in NET 45 is a ClaimsPrincipal ADFS 21    ADFS 21 is available now as a in-box server role in Windows 8    Adds support for issuing device claims from Kerberos ticket  IMAGE  </description><link>http://www.secuobs.com/revue/news/329469.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/329469.shtml</guid></item>
<item><title>Sample Relying Party for ThinktectureIdentityServer</title><description>Secuobs.com : 2011-07-06 09:53:04 - www.leastprivilege.com -    I upload a sample RP for IdentityServer It shows some basic things like connecting a web application via WS-Federation and a SOAP service via WS-Trust  IMAGE  </description><link>http://www.secuobs.com/revue/news/315367.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/315367.shtml</guid></item>
<item><title>Thinktecture Talks from NDC</title><description>Secuobs.com : 2011-07-04 15:03:19 - www.leastprivilege.com -    Ingo Rammer Hardcore Production Debugging HTML5 - Offline Business Applications for Desktops, Tablets and Phones Oliver Sturm Functional Programming in C  Function Programming in F  Dominick Baier Architecting Claims-aware Applications  with the Windows Identity Foundation and Active Directory Federation Services  Securing REST-Services and Web-APIs  IMAGE  </description><link>http://www.secuobs.com/revue/news/315046.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/315046.shtml</guid></item>
<item><title>Me on LockDown Radio</title><description>Secuobs.com : 2011-06-23 23:08:01 - www.leastprivilege.com -    Seems to be radio week this week  Another interview I did quite a while ago with Michele and Patrick  http wwwlockdownpodcastcom defaultaspx ShowNum 4  IMAGE  </description><link>http://www.secuobs.com/revue/news/313242.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/313242.shtml</guid></item>
<item><title>Access Control Service  Passive Active Transition Sample</title><description>Secuobs.com : 2011-06-23 12:57:52 - www.leastprivilege.com -    Here you can find my updated ACS2 sample In addition to the existing front ends  web  WS-Federation , console  SOAP   REST , Silverlight  REST  and error handling, it now also includes a WPF client that shows the passive active transition with a SOAP service as illustrated here All the ACS interaction is encapsulated in a WPF user control that     retrieves the JSON feed    displays a list of supported identity providers    triggers the sign in via a browser control    retrieves the token response    packages the token as a GenericXmlSecurityToken  to be used directly with the WIF ChannelFactory extensions methods  All you need to supply is the ACS namespace and the realm  IMAGE  Have fun   IMAGE  </description><link>http://www.secuobs.com/revue/news/313074.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/313074.shtml</guid></item>
<item><title>Access Control Service  Programmatically Accessing Identity Provider Information and Redirect URLs</title><description>Secuobs.com : 2011-06-23 07:56:13 - www.leastprivilege.com -    In my last post I showed you that different redirect URLs trigger different response behaviors in ACS Where did I actually get these URLs from  The answer is simple   I asked ACS   ACS publishes a JSON encoded feed that contains information about all registered identity providers, their display names, logos and URLs With that information you can easily write a discovery client which, at the very heart, does this  public       void    GetAsync    string    protocol    var    url      string   Format   https 0  1 v2 metadata IdentityProvidersjs protocol 2 realm 3 version 10    , AcsNamespace,  accesscontrolwindowsnet    , protocol, Realm  _clientDownloadStringAsync    new       Uri    url    The protocol can be one of these two values  wsfederation or javascriptnotify Based on that value, the returned JSON will contain the URLs for either the redirect or notify method Now with the help of some JSON serializer you can turn that information into CLR objects and display them in some sort of selection dialog The next post will have a demo and source code  IMAGE  </description><link>http://www.secuobs.com/revue/news/313037.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/313037.shtml</guid></item>
<item><title>More Claims on DotNetRocks</title><description>Secuobs.com : 2011-06-23 07:07:01 - www.leastprivilege.com -    I met Carl and Richard at NDC, so we took the chance to have another chat about my favourite topic  claims   http wwwdotnetrockscom defaultaspx showNum 674 Have fun   IMAGE  </description><link>http://www.secuobs.com/revue/news/313034.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/313034.shtml</guid></item>
<item><title>Access Control Service  Transitioning between Active and Passive Scenarios</title><description>Secuobs.com : 2011-06-22 20:25:14 - www.leastprivilege.com -    As I mentioned in my last post, ACS features a number of ways to transition between protocol and token types One not so widely known transition is between passive sign ins  browser  and active service consumers Let s see how this works We all know the usual WS-Federation handshake via passive redirect But ACS also allows driving the sign in process yourself via specially crafted WS-Federation query strings So you can use the following URL to sign in using LiveID via ACS ACS will then redirect back to the registered reply URL in your application  GET  loginsrf  wa wsignin10  wtrealm httpspourcents3apourcents2fpourcents2faccesscontrolwindowsnetpourcents2f  wreply httpspourcents3apourcents2fpourcents2fleastprivilegeaccesscontrolwindowsnetpourcents3a443pourcents2fv2pourcents2fwsfederation  wp MBI_FED_SSL  wctx prpourcents3dwsfederationpourcents26rmpourcents3dhttpspourcents253apourcents252fpourcents252froadiepourcents252facs2rppourcents252frestpourcents252f The wsfederation bit in the wctx parameter indicates, that the response to the token request will be transmitted back to the relying party via a POST So far so good   but how can an active client receive that token now  ACS knows an alternative way to send the token request response Instead of doing the redirect back to the RP, it emits a page that in turn echoes the token response using JavaScript s windowsexternalnotify The URL would look like this  GET  loginsrf  wa wsignin10  wtrealm httpspourcents3apourcents2fpourcents2faccesscontrolwindowsnetpourcents2f  wreply httpspourcents3apourcents2fpourcents2fleastprivilegeaccesscontrolwindowsnetpourcents3a443pourcents2fv2pourcents2fwsfederation  wp MBI_FED_SSL  wctx prpourcents3djavascriptnotifypourcents26rmpourcents3dhttpspourcents253apourcents252fpourcents252froadiepourcents252facs2rppourcents252frestpourcents252f ACS would then render a page that contains the following script block   try  windowexternalNotify 'token_response'    catch err  alert Error ACS50021  windowsexternalNotify is not registered     Whereas token_response is a JSON encoded string with the following format     appliesTo  ,  context null,  created 123,  expires 123,  securityToken  ,  tokenType     OK   so how does this all come together now  As an active client  Silverlight, WPF, WP7, WinForms etc  application, you would host a browser control and use the above URL to trigger the right series of redirects All the browser controls support one way or the other to register a callback whenever the windowexternalnotify function is called This way you get the JSON string from ACS back into the hosting application   and voila you have the security token When you selected the SWT token format in ACS   you can use that token eg for REST services When you have selected SAML, you can use the token eg for SOAP services In the next post I will show how to retrieve these URLs from ACS and a practical example using WPF  IMAGE  </description><link>http://www.secuobs.com/revue/news/312927.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/312927.shtml</guid></item>
<item><title>OT  Nice Photo Blog</title><description>Secuobs.com : 2011-06-22 12:04:42 - www.leastprivilege.com -    My good friend Heimo started blogging Given his vast arsenal of cameras and lenses, this should be an interesting read  http monoflopblogspotcom   IMAGE  </description><link>http://www.secuobs.com/revue/news/312820.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/312820.shtml</guid></item>
<item><title>Access Control Service  Protocol and Token Transition</title><description>Secuobs.com : 2011-06-22 08:59:53 - www.leastprivilege.com -    ACS v2 supports a number of protocols  WS-Federation, WS-Trust, OpenId, OAuth 2   WRAP  and a number of token types  SWT, SAML 11 20    see Vittorio s Infographic here Some protocols are designed for active client  WS-Trust, OAuth   WRAP  and some are designed for passive clients  WS-Federation, OpenID  One of the most obvious advantages of ACS is that it allows to transition between various protocols and token types Once example would be using WS-Federation SAML between your application and ACS to sign in with a Google account Google is using OpenId and non-SAML tokens, but ACS transitions into WS-Federation and sends back a SAML token This way you application only needs to understand a single protocol whereas ACS acts as a protocol bridge  see my ACS2 sample here  Another example would be transformation of a SAML token to a SWT This is achieved by using the WRAP endpoint   you send a SAML token  from a registered identity provider  to ACS, and ACS turns it into a SWT token for the requested relying party, eg  using the WrapClient from ThinktectureIdentityModel      TestMethod     public       void    GetClaimsSamlToSwt      get saml token from idp var    samlToken      Helper   GetSamlIdentityTokenForAcs    send to ACS for SWT converion var    swtToken      Helper   GetSimpleWebToken samlToken  var    client      new       HttpClient       Constants   BaseUri  clientSetAccessToken swtToken,    WebClientTokenSchemes   OAuth    call REST service with SWT var    response   clientGet     wcf client      Assert   AreEqual    HttpStatusCode   OK, responseStatusCode    There are more protocol transitions possible   but they are not so obvious A popular example would be how to call a REST SOAP service using eg a LiveId login In the next post I will show you how to approach that scenario  IMAGE  </description><link>http://www.secuobs.com/revue/news/312787.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/312787.shtml</guid></item>
<item><title>Updates for ThinktectureIdentityModel</title><description>Secuobs.com : 2011-06-17 17:05:27 - www.leastprivilege.com -    I just uploaded a new version to codeplex and nuget  ThinktectureIdentityModel  Besides some bug fixes and clean up I added the ProtectedCookie feature and some more extension methods  IMAGE  </description><link>http://www.secuobs.com/revue/news/311978.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/311978.shtml</guid></item>
<item><title>Useful Extensions for SecurityToken Handling - Convert a SecurityToken to Claims</title><description>Secuobs.com : 2011-06-17 10:50:48 - www.leastprivilege.com -    That s a very common one  public       static       IClaimsPrincipal    ToClaimsPrincipal  this       SecurityToken    token,    X509Certificate2    signingCertificate    var    configuration   CreateStandardConfiguration signingCertificate  return    tokenToClaimsPrincipal configurationCreateDefaultHandlerCollection    public       static       IClaimsPrincipal    ToClaimsPrincipal    this       SecurityToken    token,  X509Certificate2    signingCertificate,    string    audienceUri    var    configuration   CreateStandardConfiguration signingCertificate  configurationAudienceRestrictionAudienceMode      AudienceUriMode   Always  configurationAudienceRestrictionAllowedAudienceUrisAdd    new       Uri    audienceUri  return    tokenToClaimsPrincipal configurationCreateDefaultHandlerCollection    public       static       IClaimsPrincipal    ToClaimsPrincipal  this       SecurityToken    token,    SecurityTokenHandlerCollection    handler    var    ids   handlerValidateToken token  return       ClaimsPrincipal   CreateFromIdentities ids    private       static       SecurityTokenHandlerConfiguration    CreateStandardConfiguration  X509Certificate2    signingCertificate    var configuration   new SecurityTokenHandlerConfiguration  configurationAudienceRestrictionAudienceMode   AudienceUriModeNever  configurationIssuerNameRegistry   signingCertificateCreateIssuerNameRegistry  configurationIssuerTokenResolver   signingCertificateCreateSecurityTokenResolver  configurationSaveBootstrapTokens   true  return configuration    private       static       IssuerNameRegistry    CreateIssuerNameRegistry    this       X509Certificate2    certificate    var    registry      new       ConfigurationBasedIssuerNameRegistry     registryAddTrustedIssuer certificateThumbprint, certificateSubject  return    registry    private       static       SecurityTokenResolver    CreateSecurityTokenResolver  this       X509Certificate2    certificate    var    tokens      new       List      new       X509SecurityToken    certificate    return       SecurityTokenResolver   CreateDefaultSecurityTokenResolver tokensAsReadOnly ,    true       private       static       SecurityTokenHandlerCollection    CreateDefaultHandlerCollection  this       SecurityTokenHandlerConfiguration    configuration    return     SecurityTokenHandlerCollection   CreateDefaultSecurityTokenHandlerCollection configuration     IMAGE  </description><link>http://www.secuobs.com/revue/news/311899.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/311899.shtml</guid></item>
<item><title>Useful Extensions for SecurityToken Handling - Convert Tokens to Strings</title><description>Secuobs.com : 2011-06-17 09:00:01 - www.leastprivilege.com -    As part of the next release of ThinktectureIdentityModel, I added a number of extension methods I get a lot of questions about manual token handling, like how to convert a SAML token to a string, how to convert a token to claims etc Basically it all boils down to the right usage of WIF s security token handlers The extension methods wrap that nicely public       static       string    ToTokenXmlString    this       SecurityToken    token    var    genericToken   token    as       GenericXmlSecurityToken     if     genericToken      null       return    genericTokenToTokenXmlString    var    handler    SecurityTokenHandlerCollection   CreateDefaultSecurityTokenHandlerCollection  return    tokenToTokenXmlString handler    public       static       string    ToTokenXmlString    this       SecurityToken    token,  SecurityTokenHandlerCollection    handler    if     handlerCanWriteToken token    var    sb      new       StringBuilder    128  handlerWriteToken    new       XmlTextWriter       new       StringWriter    sb , token  return    sbToString    else   throw       new       InvalidOperationException        Token type not suppoted          public       static       string    ToTokenXmlString    this       GenericXmlSecurityToken    token    return    tokenTokenXmlOuterXml    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/311883.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/311883.shtml</guid></item>
<item><title>Migrating a Local IdentityServer Membership Database to SQL Azure</title><description>Secuobs.com : 2011-06-09 15:03:18 - www.leastprivilege.com -    This is a useful tool to accomplish this  http sqlazuremwcodeplexcom  IMAGE  </description><link>http://www.secuobs.com/revue/news/310153.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/310153.shtml</guid></item>
<item><title>IdentityServer Azure Edition Screencast</title><description>Secuobs.com : 2011-06-06 23:13:20 - www.leastprivilege.com -    I recorded a short screencast about the Windows Azure Edition of IdentityServer It includes a quick walkthrough of the solution and setup instructions http identitythinktecturecom download identityserver WindowsAzureEditionB1wmv  IMAGE  </description><link>http://www.secuobs.com/revue/news/309455.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/309455.shtml</guid></item>
<item><title>Protecting Cookies  Once and For All</title><description>Secuobs.com : 2011-06-01 07:29:53 - www.leastprivilege.com -    Every once in a while you run into a situation where you need to temporarily store data for a user in a web app You typically have two options here   either store server-side or put the data into a cookie  if size permits  When you need web farm compatibility in addition   things become a little bit more complicated because the data needs to be available on all nodes In my case I went for a cookie   but I had some requirements    Cookie must be protected from eavesdropping  sent only over SSL  and client script    Cookie must be encrypted and signed to be protected from tampering with    Cookie might become bigger than 4KB   some sort of overflow mechanism would be nice I really didn t want to implement another cookie protection mechanism   this feels wrong and btw can go wrong as well WIF to the rescue The session management feature already implements the above requirements but is built around de serializing IClaimsPrincipals into cookies and back But if you go one level deeper you will find the CookieHandler and CookieTransform classes which contain all the needed functionality public       class       ProtectedCookie   private       List    _transforms  private       ChunkedCookieHandler    _handler      new       ChunkedCookieHandler       DPAPI protection  single server  public    ProtectedCookie    _transforms      new       List       new       DeflateCookieTransform    ,  new       ProtectedDataCookieTransform            RSA protection  load balanced  public    ProtectedCookie    X509Certificate2    protectionCertificate    _transforms      new       List       new       DeflateCookieTransform    ,  new       RsaSignatureCookieTransform    protectionCertificate , new       RsaEncryptionCookieTransform    protectionCertificate        custom transform pipeline public    ProtectedCookie    List    transforms    _transforms   transforms    public       void    Write    string    name,    string    value,    DateTime    expirationTime    byte     encodedBytes   EncodeCookieValue value  _handlerWrite encodedBytes, name, expirationTime    public       void    Write    string    name,    string    value,    DateTime    expirationTime,  string    domain,    string    path    byte     encodedBytes   EncodeCookieValue value  _handlerWrite encodedBytes,  name,  path,  domain,  expirationTime,  true   ,  true   ,  HttpContext   Current    public       string    Read    string    name    var    bytes   _handlerRead name  if     bytes      null     bytesLength   0    return       null       return    DecodeCookieValue bytes    public       void    Delete    string    name    _handlerDelete name    protected       virtual       byte     EncodeCookieValue    string    value    var    bytes      Encoding   UTF8GetBytes value  byte     buffer   bytes  foreach        var    transform    in    _transforms    buffer   transformEncode buffer    return    buffer    protected       virtual       string    DecodeCookieValue    byte     bytes    var    buffer   bytes  for        int    i   _transformsCount  i  0  i    buffer   _transforms i - 1 Decode buffer    return       Encoding   UTF8GetString buffer      HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/308386.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/308386.shtml</guid></item>
<item><title>IdentityServer Beta 1 Refresh  Windows Azure Support</title><description>Secuobs.com : 2011-05-31 23:10:20 - www.leastprivilege.com -    I just uploaded two new releases to Codeplex  IMAGE  IdentityServer B1 refresh A number of bug fixes and streamlined extensibility interfaces Mostly a result of adding the Windows Azure support Nothing has changed with regards to setup Make sure you watch the intro video on the Codeplex site IdentityServer B1  Windows Azure Edition  I have now implemented all repositories for Windows Azure backed data storage The default setup assumes you use the ASPNET SQL membership provider database in SQL Azure and Table Storage for relying party, client certificates and delegation settings The setup is simple     Upload your SSL signing certificate via the portal    Adjust the cscfg file   you need to insert your storage account, certificate thumbprint and distinguished name    There is a setup tool that can automatically insert the certificate distinguished names into your config file    Adjust the connection string for the membership database in WebSite configuration connectionStringconfig    Deploy Feedback Feature-wise this looks like the V1 release to me It would be great if you could give me feedback, when you find a bug etc   especially     Do the built-in repository implementations work for you  both on-premise and Azure     Are the repository interfaces enough to add you own data store or feature   IMAGE  </description><link>http://www.secuobs.com/revue/news/308255.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/308255.shtml</guid></item>
<item><title>Weird 302 Redirects in Windows Azure</title><description>Secuobs.com : 2011-05-31 06:49:22 - www.leastprivilege.com -    In IdentityServer I don t use Forms Authentication but the session facility from WIF That also means that I implemented my own redirect logic to a login page when needed To achieve that I turned off the built-in authentication  authenticationMode none  and added an Application_EndRequest handler that checks for 401s and does the redirect to my sign in route The redirect only happens for web pages and not for web services This all works fine in local IIS   but in the Azure Compute Emulator and Windows Azure many of my tests are failing and I suddenly see 302 status codes where I expected 401s  the web service calls  After some debugging kung-fu and enabling FREB I found out, that there is still the Forms Authentication module in effect turning 401s into 302s My EndRequest handler never sees a 401  despite turning forms auth off in config  Not sure what s going on  I suspect some inherited configuration that gets in my way here  Even if it shouldn t be necessary, an explicit removal of the forms auth module from the module list fixed it, and I now have the same behavior in local IIS and Windows Azure strange    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/308062.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/308062.shtml</guid></item>
<item><title>Access Control Service  Handling Errors</title><description>Secuobs.com : 2011-05-29 10:29:55 - www.leastprivilege.com -    Another common problem with external authentication is how to deal with sign in errors In active federation like WS-Trust there are well defined SOAP faults to communicate problem to a client But with web applications, the error information is typically generated and displayed on the external sign in page The relying party does not know about the error, nor can it help the user in any way The Access Control Service allows to post sign in errors to a specified page You setup this page in the relying party registration That means that whenever an error occurs in ACS, the error information gets packaged up as a JSON string and posted to the page specified This way you get structued error information back into you application so you can display a friendlier error message or log the error I added error page support to my ACS2 sample, which can be downloaded here How to turn the JSON error into CLR types The JSON schema is reasonably simple, the following class turns the JSON into an object      DataContract     public       class       AcsErrorResponse       DataMember    Name       context    , Order   1  public       string    Context      get        set           DataMember    Name       httpReturnCode    , Order   2  public       string    HttpReturnCode      get        set           DataMember    Name       identityProvider    , Order   3      public       string    IdentityProvider      get        set           DataMember    Name       timeStamp    , Order   4  public       string    TimeStamp      get        set           DataMember    Name       traceId    , Order   5  public       string    TraceId      get        set           DataMember    Name       errors    , Order   6  public       List    Errors      get        set       public       static       AcsErrorResponse    Read    string    json    var    serializer      new       DataContractJsonSerializer     typeof       AcsErrorResponse     var    response   serializerReadObject  new       MemoryStream       Encoding   DefaultGetBytes json     as       AcsErrorResponse     if     response      null       return    response    else   throw       new       ArgumentException        json                DataContract     public       class       AcsError       DataMember    Name       errorCode    , Order   1  public       string    Code      get        set           DataMember    Name       errorMessage    , Order   2  public       string    Message      get        set         Retrieving the error information You then need to provide a page that takes the POST and deserializes the information My sample simply fills a view that shows all information But that s for diagnostic sample purposes only You shouldn t show the real errors to your end users public       class       SignInErrorController         Controller       HttpPost     public       ActionResult    Index    var    errorDetails   RequestForm     ErrorDetails      var    response      AcsErrorResponse   Read errorDetails   return    View     SignInError    , response      Also keep in mind that the error page is an anonymous page and that you are taking external input So all the usual input validation applies  IMAGE  </description><link>http://www.secuobs.com/revue/news/307826.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/307826.shtml</guid></item>
<item><title>Access Control Service  Home Realm Discovery  HRD  Gotcha</title><description>Secuobs.com : 2011-05-24 21:22:55 - www.leastprivilege.com -    I really like ACS2 One feature that is very useful is home realm discovery ACS provides a Nascar style list as well as discovery based on email addresses You can take control of the home realm selection process yourself by downloading the JSON feed or by manually setting the home realm parameter Plenty of options   the only option missing is turning it off  In other words, when you setup your ACS namespace and realm and register identity provider, there is no way to keep the list of identity providers secret An interested  user  can always retrieve all registered identity provider  using the browser or download the JSON feed  This may not be an issue with web identity providers, but when you use ACS to federate with customers or business partners, you maybe don t want to disclose that list to the public  or to other customers  This is an adoption blocker for certain situations I hope this feature will be added soon In addition I would also like to see a feature I call  home realm aliases  Some random string that I can use as a whr parameter instead of using the real issuer URI  IMAGE  </description><link>http://www.secuobs.com/revue/news/306876.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/306876.shtml</guid></item>
<item><title>Access Control Service  Walkthrough Videos of Web Application, SOAP, REST and Silverlight Integration</title><description>Secuobs.com : 2011-05-24 14:25:41 - www.leastprivilege.com -    Over the weekend I worked a little more on my ACS2 sample Instead of writing it all down, I decided to quickly record four short videos that cover the relevant features and code Have fun   Part 1   Overview This video does a quick walkthrough of the solution and shows the web application part This includes driving the sign in UI via JavaScript  thanks Matias  as well as the registration logic I wrote about here watch Part 2   SOAP Service and Client The sample app also exposes a WCF SOAP service This video shows how to wire up the service to ACS and hows how to create a client that first requests a token from an IdP and then sends this token to ACS watch Part 3   REST Service and Client This part shows how to set up a WCF REST service that consumes SWT tokens from ACS Unfortunately there is currently no standard WIF plumbing for REST For the service integration I had to combine a lot of code from different sources  kzu, zulfiq  as well as the WIF SDK and OAuth CTPs together But it is working watch Part 4   Silverlight and Web Identity Integration This part took by far the most time to write The Silverlight Client shows ho to sign in to the application using a registered identity provider  including web identities  and using the resulting SWT token to call our REST service This is designed to be a desktop  OOB  client application  thanks to Jörg for the UI magic   IMAGE  watch code download  IMAGE  </description><link>http://www.secuobs.com/revue/news/306779.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/306779.shtml</guid></item>
<item><title>Requesting Delegation  ActAs  Tokens using WSTrustChannel  as opposed to Configuration Madness </title><description>Secuobs.com : 2011-05-24 09:01:00 - www.leastprivilege.com -    Delegation using the ActAs approach has some interesting security features    A security token service can make authorization and validation checks before issuing the ActAs token    Combined with proof keys you get non-repudiation features    The ultimate receiver sees the original caller as direct caller and can optionally traverse the delegation chain    Encryption and audience restriction can be tied down Most samples out there  including the SDK sample  use the CreateChannelActingAs extension method from WIF to request ActAs tokens This method builds on top of the WCF binding configuration which may not always be suitable for your situation You can also use the WSTrustChannel to request ActAs tokens This allows direct and programmatic control over bindings and configuration and is my preferred approach The below method requests an ActAs token based on a bootstrap token The returned token can then directly be used with the CreateChannelWithIssued token extension method private       SecurityToken    GetActAsToken    SecurityToken    bootstrapToken    var    factory      new       WSTrustChannelFactory     new       UserNameWSTrustBinding       SecurityMode   TransportWithMessageCredential , new       EndpointAddress    stsAddress  factoryTrustVersion      TrustVersion   WSTrust13  factoryCredentialsUserNameUserName       middletier      factoryCredentialsUserNamePassword       abc 123      var    rst      new       RequestSecurityToken   AppliesTo      new       EndpointAddress    serviceAddress , RequestType      RequestTypes   Issue, KeyType      KeyTypes   Symmetric, ActAs      new       SecurityTokenElement    bootstrapToken    var    channel   factoryCreateChannel  var    delegationToken   channelIssue rst  return    delegationToken    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/306736.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/306736.shtml</guid></item>
<item><title>Access Control Service v2  Registering Web Identities in your Applications  code </title><description>Secuobs.com : 2011-05-21 19:41:50 - www.leastprivilege.com -    You can download the full solution here The relevant parts in the sample are  Configuration I use the standard WIF configuration with passive redirect This kicks automatically in, whenever authorization fails in the application  eg when the user tries to get to an area the requires authentication or needs registration  Checking and transforming incoming claims In the claims authentication manager we have to deal with two situations Users that are authenticated but not registered, and registered  and authenticated  users Registered users will have claims that come from the application domain, the claims of unregistered users come directly from ACS and get passed through In both case a claim for the unique user identifier will be generated The high level logic is as follows  public       override       IClaimsPrincipal    Authenticate  string    resourceName,    IClaimsPrincipal    incomingPrincipal      do nothing if anonymous request if     incomingPrincipalIdentityIsAuthenticated    return       base   Authenticate resourceName, incomingPrincipal       string    uniqueId   GetUniqueId incomingPrincipal    check if user is registered RegisterModel    data  if     RepositoryTryGetRegisteredUser uniqueId,    out    data    return    CreateRegisteredUserPrincipal uniqueId, data      authenticated by ACS, but not registered   create unique id claim incomingPrincipalIdentities 0 ClaimsAdd  new       Claim       Constants      ClaimTypes   Id, uniqueId  return    incomingPrincipal    User Registration The registration page is handled by a controller with the  Authorize  attribute That means you need to authenticate before you can register  crazy eh    The controller then fetches some claims from the identity provider  if available  to pre-fill form fields After successful registration, the user is stored in the local data store and a new session token gets issued This effectively replaces the ACS claims with application defined claims without requiring the user to re-signin Authorization All pages that should be only reachable by registered users check for a special application defined claim that only registered users have You can nicely wrap that in a custom attribute in MVC      RegisteredUsersOnly     public       ActionResult    Registered    return    View    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/306362.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/306362.shtml</guid></item>
<item><title>Access Control Service v2  Registering Web Identities in your Applications  concepts </title><description>Secuobs.com : 2011-05-21 18:55:22 - www.leastprivilege.com -    ACS v2 support two fundamental types of client identities  I like to call them  enterprise identities   WS-  and  web identities   Google, LiveID, OpenId in general  I also see two different  mind sets  when it comes to application design using the above identity types     Enterprise identities   often the fact that a client can present a token from a trusted identity provider means he is a legitimate user of the application Trust relationships and authorization details have been negotiated out of band  often on paper     Web identities   the fact that a user can authenticate with Google et al does not necessarily mean he is a legitimate  or registered  user of an application Typically additional steps are necessary  like filling out a form, email confirmation etc  Sometimes also a mixture of both approaches exist, for the sake of this post, I will focus on the web identity case I got a number of questions how to implement the web identity scenario and after some conversations it turns out it is the old authentication vs authorization problem that gets in the way Many people use the IsAuthenticated property on IIdentity to make security decisions in their applications  or deny user  in ASPNET terms  That s a very natural thing to do, because authentication was done inside the application and we knew exactly when the IsAuthenticated condition is true Been there, done that Guilty   The fundamental difference between these  old style  apps and federation is, that authentication is not done by the application anymore It is done by a third party service, and in the case of web identity providers, in services that are not under our control  nor do we have a formal business relationship with these providers  Now the issue is, when you switch to ACS, and someone with a Google account authenticates, indeed IsAuthenticated is true   because that s what he is  This does not mean, that he is also authorized to use the application It just proves he was able to authenticate with Google Now this obviously leads to confusion How can we solve that  Easy answer  We have to deal with authentication and authorization separately Job done   For many application types I see this general approach     Application uses ACS for authentication  maybe both enterprise and web identities, we focus on web identities but you could easily have a dual approach here     Application offers to authenticate  or sign in  via web identity accounts like LiveID, Google, Facebook etc    Application also maintains a database of its  own  users Typically you want to store additional information about the user In such an application type it is important to have a unique identifier for your users  think the primary key of your user database  What would that be  Most web identity provider  and all the standard ACS v2 supported ones  emit a NameIdentifier claim This is a stable ID for the client  scoped to the relying party   more on that later  Furthermore ACS emits a claims identifying the identity provider  like the original issuer concept in WIF  When you combine these two values together, you can be sure to have a unique identifier for the user, eg  Facebook-134952459903700 799880347 You can now check on incoming calls, if the user is already registered and if yes, swap the ACS claims with claims coming from your user database One claims would maybe be a role like  Registered User  which can then be easily used to do authorization checks in the application The WIF claims authentication manager is a perfect place to do the claims transformation If the user is not registered, show a register form Maybe you can use some claims from the identity provider to pre-fill form fields  see here where I show how to use the Facebook API to fetch additional user properties  After successful registration  which may include other mechanisms like a confirmation email , flip the bit in your database to make the web identity a registered user This is all very theoretical In the next post I will show some code and provide a download link for the complete sample More on NameIdentifier Identity providers  guarantee  that the name identifier for a given user in your application will always be the same But different applications  in the case of ACS   different ACS namespaces  will see different name identifiers This is by design to protect the privacy of users because identical name identifiers could be used to create  profiles  of some sort for that user In technical terms they create the name identifier approximately like this  name identifier   Hash Provider Internal User ID     Relying Party Address  Why is this important to know  Well   when you change the name of your ACS namespace, the name identifiers will change as well and you will will lose your  connection  to your existing users Oh an btw   never use any other claims  like email address or name  to form a unique ID   these can often be changed by users  IMAGE  </description><link>http://www.secuobs.com/revue/news/306360.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/306360.shtml</guid></item>
<item><title>ThinktectureIdentityServer Beta 1</title><description>Secuobs.com : 2011-05-20 17:06:13 - www.leastprivilege.com -    I just upload beta 1 to codeplex Please test this version and give me feedback Some quick notes on setup    Watch the intro screencast on the codeplex site    Use the setup tool to set the signing and SSL certificate You can now also set the ACLs on the private key for your worker pool account    IIS is required     SSL for the IIS site the STS runs in is required    Users of the STS must be in the 'IdentityServerUsers' role    Admins of the STS must be in the 'IdentityServerAdministrators' roles What s new  Mainly smaller bits and pieces and some refactoring The biggest under the cover change is a new authorization model for the STS itself If, eg you don t like the new roles I introduced, you can easily change the behavior in the claims authorization manager in the STS web site project What s missing  The big one is Azure support Not that I ran into unforeseeable problems here, I just wanted to wait until the on-premise version is more stabilized Now with B1 I can start adding Azure support back  IMAGE  </description><link>http://www.secuobs.com/revue/news/306147.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/306147.shtml</guid></item>
<item><title>Small Gotcha when Adding ADFS as an Identity Provider in ACS v2</title><description>Secuobs.com : 2011-05-12 14:32:33 - www.leastprivilege.com -    It turns out that ACS v2 currently supports two  types  of signing certificates for identity providers     self signed certificates    certificates that chain up to a trusted root  from Microsoft s perspective , eg VeriSign In other words, when you use a signing certificate in ADFS that comes from your internal PKI, it won t work I hope this will get fixed   err   changed soon  IMAGE  </description><link>http://www.secuobs.com/revue/news/304301.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/304301.shtml</guid></item>
<item><title>UIs  Only with Annotations </title><description>Secuobs.com : 2011-05-10 09:28:12 - www.leastprivilege.com -    I don t really know what I am talking about here   But Jörg does http headwritelineblogspotcom 2011 05 just-released-thinktecturehtml  IMAGE  </description><link>http://www.secuobs.com/revue/news/303732.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/303732.shtml</guid></item>
<item><title>Improving WIFs Claims-based Authorization - Part 3  Usage </title><description>Secuobs.com : 2011-05-04 16:02:18 - www.leastprivilege.com -    In the previous posts I showed off some of the additions I made to WIF s authorization infrastructure I now want to show some samples how I actually use these extensions The following code snippets are from ThinktectureIdentityServer on Codeplex The following shows the MVC attribute on the WS-Federation controller      ClaimsAuthorize       Constants      Actions   Issue,    Constants      Resources   WSFederation  public       class       WSFederationController         Controller or      ClaimsAuthorize       Constants      Actions   Administration,    Constants      Resources   RelyingParty  public       class       RelyingPartiesAdminController         Controller In other places I used the imperative approach  eg the WRAP endpoint  if        ClaimsAuthorize   CheckAccess principal,    Constants      Actions   Issue,    Constants      Resources   WRAP    Tracing   Error     User not authorized      return       new       UnauthorizedResult        WRAP    ,    true       For the WCF WS-Trust endpoints I decided to use the per-request approach since the SOAP actions are well defined here The corresponding authorization manager roughly looks like this  public       class       AuthorizationManager         ClaimsAuthorizationManager   public       override       bool    CheckAccess    AuthorizationContext    context    var    action   contextActionFirst  var    id   contextPrincipalIdentitiesFirst    if application authorization request if     actionClaimTypeEquals    ClaimsAuthorize   ActionType    return    AuthorizeCore action, contextResource, contextPrincipalIdentity    as       IClaimsIdentity         if ws-trust issue request if     actionValueEquals    WSTrust13Constants      Actions   Issue    return    AuthorizeTokenIssuance    new       Collection          new       Claim       ClaimsAuthorize   ResourceType,    Constants      Resources   WSTrust   , id    return       base   CheckAccess context      You see that it is really easy now to distinguish between per-request and application authorization which makes the overall design much easier HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/302558.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/302558.shtml</guid></item>
<item><title>Improving WIFs Claims-based Authorization - Part 2</title><description>Secuobs.com : 2011-05-04 12:46:09 - www.leastprivilege.com -    In the last post I showed you how to take control over the invocation of ClaimsAuthorizationManager Then you have complete freedom over the claim types, the amount of claims and the values In addition I added two attributes that invoke the authorization manager using an  application claim type  This way it is very easy to distinguish between authorization calls that originate from WIF s per-request authorization and the ones from  within  you application The attribute comes in two flavours  a CAS attribute  invoke by the CLR  and an ASPNET MVC attribute  for MVC controllers, invoke by the MVC plumbing  Both also feature static methods to easily call them using the application claim types The CAS attribute is part of ThinktectureIdentityModel on Codeplex  or via NuGet  Install-Package ThinktectureIdentityModel  If you really want to see that code   There is also a sample included in the Codeplex donwload The MVC attribute is currently used in ThinktectureIdentityServer   and I don t currently plan to make it part of the library project since I don t want to add a dependency for MVC for now You can find the code below   and I will write about its usage in a follow-up post public       class       ClaimsAuthorize         AuthorizeAttribute   private       string    _resource  private       string    _action  private       string     _additionalResources                Default action claim type          public       const       string    ActionType       http application claims authorization action                    Default resource claim type          public       const       string    ResourceType       http application claims authorization resource                    Additional resource claim type          public       const       string    AdditionalResourceType       http application claims authorization additionalresource   public ClaimsAuthorize string action, string resource, params string  additionalResources    _action   action  _resource   resource  _additionalResources   additionalResources    public static bool CheckAccess  string action, string resource, params string  additionalResources    return CheckAccess  ThreadCurrentPrincipal as IClaimsPrincipal, action, resource, additionalResources    public static bool CheckAccess  IClaimsPrincipal principal, string action, string resource, params string  additionalResources    var context   CreateAuthorizationContext  principal, action, resource, additionalResources  return ClaimsAuthorizationCheckAccess context    protected override bool AuthorizeCore HttpContextBase httpContext    return CheckAccess action, _resource, _additionalResources    private static WIFAuthorizationContext CreateAuthorizationContext  IClaimsPrincipal principal, string action, string resource, params string  additionalResources    var actionClaims   new Collection   new Claim ActionType, action    var resourceClaims   new Collection   new Claim ResourceType, resource    if  additionalResources   null   additionalResourcesLength  0    additionalResourcesToList ForEach ar   resourceClaimsAdd  new Claim AdditionalResourceType, ar    return new WIFAuthorizationContext  principal, resourceClaims, actionClaims       IMAGE  </description><link>http://www.secuobs.com/revue/news/302513.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/302513.shtml</guid></item>
<item><title>Improving WIFs Claims-based Authorization - Part 1</title><description>Secuobs.com : 2011-05-03 11:39:36 - www.leastprivilege.com -    As mentioned in my last post, I made several additions to WIF s built-in authorization infrastructure to make it more flexible and easy to use The foundation for all this work is that you have to be able to directly call the registered ClaimsAuthorizationManager The following snippet is the universal way to get to the WIF configuration that is currently in effect  public       static       ServiceConfiguration    ServiceConfiguration   get   if        OperationContext   Current      null         no WCF return       FederatedAuthentication   ServiceConfiguration      search message property if        OperationContext   CurrentIncomingMessageProperties ContainsKey     ServiceConfiguration        var    configuration      OperationContext   Current IncomingMessageProperties     ServiceConfiguration         as       ServiceConfiguration     if     configuration      null       return    configuration        return configuration from configuration file return       new       ServiceConfiguration            From here you can grab ServiceConfigurationClaimsAuthoriationManager which give you direct access to the CheckAccess method  and thus control over claim types and values  I then created the following wrapper methods  public static bool CheckAccess string resource, string action    return CheckAccess resource, action, ThreadCurrentPrincipal as IClaimsPrincipal    public static bool CheckAccess string resource, string action, IClaimsPrincipal principal    var context   new AuthorizationContext principal, resource, action  return AuthorizationManagerCheckAccess context    public static bool CheckAccess Collection actions, Collection resources    return CheckAccess new AuthorizationContext  ThreadCurrentPrincipalAsClaimsPrincipal , resources, actions    public static bool CheckAccess AuthorizationContext context    return AuthorizationManagerCheckAccess context    I also created the same set of methods but called DemandAccess They internally use CheckAccess and will throw a SecurityException when false is returned All the code is part of ThinktectureIdentityModel on Codeplex   or via NuGet  Install-Package ThinktectureIdentityModel   IMAGE  </description><link>http://www.secuobs.com/revue/news/302204.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/302204.shtml</guid></item>
<item><title>What I dont like about WIFs Claims-based Authorization</title><description>Secuobs.com : 2011-04-30 09:04:15 - www.leastprivilege.com -    In my last post I wrote about what I like about WIF s proposed approach to authorization   I also said that I definitely would build upon that infrastructure for my own systems But implementing such a system is a little harder as it could be Here s why  and that s purely my perspective  First of all WIF s authorization comes in two  modes     Per-request authorization When an ASPNET WCF request comes in, the registered authorization manager gets called For SOAP the SOAP action gets passed in For HTTP requests  ASPNET, WCF REST  the URL and verb    Imperative authorization This happens when you explicitly call the claims authorization API from within your code There you have full control over the values for action and resource In ASPNET per-request authorization is optional  depends on if you have added the ClaimsAuthorizationHttpModule  In WCF you always get the per-request checks as soon as you register the authorization manager in configuration I personally prefer the imperative authorization because first of all I don t believe in URL based authorization Especially in the times of MVC and routing tables, URLs can be easily changed   but then you also have to adjust your authorization logic every time Also   you typically need more knowledge than a simple  if user x is allowed to invoke operation x  One problem I have is, both the per-request calls as well as the standard WIF imperative authorization APIs wrap actions and resources in the same claim type This makes it hard to distinguish between the two authorization modes in your authorization manager But you typically need that feature to structure your authorization policy evaluation in a clean way The second problem  which is somehow related to the first one  is the standard API for interacting with the claims authorization manager The API comes as an attribute  ClaimsPrincipalPermissionAttribute  as well as a class to use programmatically  ClaimsPrincipalPermission  Both only allow to pass in simple strings  which results in the wrapping with standard claim types mentioned earlier  Both throw a SecurityException when the check fails The attribute is a code access permission attribute  like PrincipalPermission  That means it will always be invoked regardless how you call the code This may be exactly what you want, or not In a unit testing situation  like an MVC controller  you typically want to test the logic in the function   not the security check The good news is, the WIF API is flexible enough that you can build your own infrastructure around their core For my own projects I implemented the following extensions     A way to invoke the registered claims authorization manager with more overloads, eg with different claim types or a complete AuthorizationContext    A new CAS attribute  with the same calling semantics as the built-in one  with custom claim types    A MVC authorization attribute with custom claim types    A way to use branching   as opposed to catching a SecurityException I will post the code for these various extensions here   so stay tuned  IMAGE  </description><link>http://www.secuobs.com/revue/news/301781.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/301781.shtml</guid></item>
<item><title>What I like about WIFs Claims-based Authorization</title><description>Secuobs.com : 2011-04-30 08:18:59 - www.leastprivilege.com -    In  traditional  NET with its IPrincipal interface and IsInRole method, developers were encouraged to write code like this  public void AddCustomer Customer customer    if  ThreadCurrentPrincipalIsInRole Sales      add customer     In code reviews I ve seen tons of code like this What I don t like about this is, that two concerns in your application get tightly coupled  business and security logic But what happens when the security requirements change   and they will  eg members of the sales role and some other people from different roles need to create customers  Well   since your security logic is sprinkled across your project you need to change the security checks in all relevant places  and make sure you don t forget one  and you need to re-test, re-stage and re-deploy the complete app This is clearly not what we want WIF s claims-based authorization encourages developers to separate business code and authorization policy evaluation This is a good thing So the same security check with WIF s out-of-the box APIs would look like this  public void AddCustomer Customer customer    try   ClaimsPrincipalPermissionCheckAccess Customer ,  Add    add customer   catch  SecurityException ex      access denied     You notice the fundamental difference  The security check only describes what the code is doing  represented by a resource action pair    and does not state who is allowed to invoke the code As I mentioned earlier   the who is most probably changing over time   the what most probably not The call to ClaimsPrincipalPermission hands off to another class called the ClaimsAuthorizationManager This class handles the evaluation of your security policy and is ideally in a separate assembly to allow updating the security logic independently from the application logic  and vice versa  The claims authorization manager features a method called CheckAccess that retrieves three values  wrapped inside an AuthorizationContext instance    action  add , resource  customer  and the principal  including its claims  in question CheckAccess then evaluates those three values and returns true false I really like the separation of concerns part here Unfortunately there is not much support from Microsoft beyond that point And without further tooling and abstractions the CheckAccess method quickly becomes  very  complex But still I think that is the way to go In the next post I will tell you what I don t like about it  and how to fix it   IMAGE  </description><link>http://www.secuobs.com/revue/news/301778.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/301778.shtml</guid></item>
<item><title>Kryptographie fr NET Entwickler auf Channel9</title><description>Secuobs.com : 2011-04-27 22:39:08 - www.leastprivilege.com -    Der zweite Schwung Videos von meinem Besuch bei Microsoft in München ist nun auch fertig Teil 1 - Historie, symmetrische Kryptografie und Hashing  http channel9msdncom Blogs Lori Kryptografie-Teil-1  Teil 2   asymmetrische Krypografie, X509 Zertifikate, PKCS und SSL  http channel9msdncom Blogs Lori Kryptografie-Teil-2   IMAGE  </description><link>http://www.secuobs.com/revue/news/301233.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/301233.shtml</guid></item>
<item><title>Access Control Service V2 and Facebook Integration</title><description>Secuobs.com : 2011-04-22 17:24:30 - www.leastprivilege.com -    I haven t been blogging about ACS2 in the past because it was not released and I was kinda busy with other stuff Needless to say I spent quite some time with ACS2 already  both in customer situations as well as in the classroom and at conferences  ACS2 rocks  It s IMHO the most interesting and useful  and most unique  part of the whole Azure offering  For my talk at VSLive yesterday, I played a little with the Facebook integration See Steve s post on the general setup One claim that you get back from Facebook is an access token This token can be used to directly talk to Facebook and query additional properties about the user Which properties you have access to depends on which authorization your Facebook app requests You can specify this in the identity provider registration page for Facebook in ACS2 In my example I added access to the home town property of the user Once you have the access token from ACS you can use eg the Facebook SDK from Codeplex  also available via NuGet  to talk to the Facebook API In my sample I used the WIF ClaimsAuthenticationManager to add the additional home town claim This is not necessarily how you would do it in a  real  app Depends   The code looks like this  sample code  public       class       ClaimsTransformer         ClaimsAuthenticationManager   public       override       IClaimsPrincipal    Authenticate  string    resourceName,    IClaimsPrincipal    incomingPrincipal    if     incomingPrincipalIdentityIsAuthenticated    return       base   Authenticate resourceName, incomingPrincipal    string    accessToken  if     incomingPrincipalTryGetClaimValue   http wwwfacebookcom claims AccessToken    ,    out    accessToken    try   var    home   GetFacebookHometown accessToken  if        string   IsNullOrWhiteSpace home    incomingPrincipalIdentities 0 ClaimsAdd  new       Claim        http wwwfacebookcom claims HomeTown    , home      catch          return    incomingPrincipal    private string GetFacebookHometown string token    var client   new FacebookClient token  dynamic parameters   new ExpandoObject  parametersfields    hometown  dynamic result   clientGet me , parameters  return resulthometownname       IMAGE  </description><link>http://www.secuobs.com/revue/news/300281.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/300281.shtml</guid></item>
<item><title>TechDays 2011 Sweden Videos</title><description>Secuobs.com : 2011-04-17 09:44:02 - www.leastprivilege.com -    All the videos from the excellent Örebro event are now online   Dominick Baier  A Technical Introduction to the Windows Identity Foundation  watch    Dominick Baier   Christian Weyer  Securing REST-Services and Web APIs on the Windows Azure Platform  watch    Christian Weyer  Real World Azure - Elasticity from on-premise to the cloud and back  watch     Our interview with Robert  watch   IMAGE  </description><link>http://www.secuobs.com/revue/news/298968.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/298968.shtml</guid></item>
<item><title>Using Robocopy to Backup to a NAS</title><description>Secuobs.com : 2011-04-11 13:36:52 - www.leastprivilege.com -    When using Robocopy to backup data to a NAS, I always had the problem that most files were considered  old  on the NAS device  even if they weren t    that kind of defeats the purpose of the  MIR switch Today I finally decided to search for a solution   and it was remarkably easy Most NAS devices use Samba or something similar to provide  NTFS shares    but most of them only implement FAT-style file times with a 2-second-granularity You can force robocopy to use FAT file time as well using the  FFT switch Now my backup script works again as expected See also here  IMAGE  </description><link>http://www.secuobs.com/revue/news/297508.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/297508.shtml</guid></item>
<item><title>IdentityServer CTP 1 Refresh</title><description>Secuobs.com : 2011-04-11 13:36:52 - www.leastprivilege.com -    I uploaded a small refresh of IdentityServer to Codeplex Mostly bug fixes and an experimental OAuth 2  WRAP  endpoint I also included a sample RP to go along  IMAGE  </description><link>http://www.secuobs.com/revue/news/297507.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/297507.shtml</guid></item>
<item><title>Windows Security Videos auf Channel 9</title><description>Secuobs.com : 2011-04-06 16:33:45 - www.leastprivilege.com -    Ich habe vor ein paar Wochen mit Lori drei Videos zum Thema Windows Security für Entwickler aufgenommen   die sind nun Online Der erste Teil beschäftigt sich mit den absoluten Grundlagen der Windows Sicherheit Was ist ein Konto  Was ist eine SID  Was ist ein Windows Token  Weiterhin wird gezeigt, wie sich diese grundlegenden Windows Einrichtungen über Managed Code anprogrammieren lassen Der Vortrag endet mit einem kleinen Einblick in die Vorgehensweise von UAC, und wie dieses programmatisch verwendet werden kann http channel9msdncom Blogs Lori Windows-Security-fr-Developers-Teil-1 Teil zwei beschäfitgt sich mit Zugriffs-Kontrolllisten, und wie diese mit NET Code gelesen und geschrieben werden können Weiterhin werden die beiden verwandten Konzepte Logon Session und Impersonierung besprochen Beide Einrichtungen erzeugen einen neuen Token, sind aber grundlegend verschieden in ihren Einsatzgebieten http channel9msdncom Blogs Lori Windows-Security-fr-Developers-Teil-2 Teil drei stellt das Kerberos Netzwerk-Authentifizierungsprotokoll vor Da dieses Protokoll standardmäßig in Active Directory verwendet wird, sollten man es in den Grundzügen kennen Natürlich kann auch Kerberos aus Managed Code verwendet werden   die abschließende Demo zeigt wie dies funktioniert http channel9msdncom Blogs Lori Windows-Security-fr-Developers-Teil-3  und noch ein kleines Interview http channel9msdncom Blogs Lori Interview-mit-Dominick-Baier Viel Spaß    IMAGE  </description><link>http://www.secuobs.com/revue/news/296619.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/296619.shtml</guid></item>
<item><title>TechDays Sweden 2011</title><description>Secuobs.com : 2011-04-01 12:38:17 - www.leastprivilege.com -    We had a really good time in Sweden Thanks for Microsoft and the organizers staff  Robert did a short interview with Christian and me Enjoy   http wwwyoutubecom watch v cGFaX_2GIPw  IMAGE  </description><link>http://www.secuobs.com/revue/news/295639.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/295639.shtml</guid></item>
<item><title>Progress on Thinktecture IdentityServer</title><description>Secuobs.com : 2011-04-01 09:36:25 - www.leastprivilege.com -    I just uploaded the very first CTP1 of thinktecture IdentityServer to codeplex I wanted to make this code available to gather feedback and extended review Keep in mind it is not done yet I also recorded an intro screencast that briefly walks through the new codebase Have fun   IMAGE  </description><link>http://www.secuobs.com/revue/news/295600.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/295600.shtml</guid></item>
<item><title>StarterSTS 15 Download and thinktecture IdentityServer</title><description>Secuobs.com : 2011-03-11 11:54:35 - www.leastprivilege.com -    The source code for StarterSTS 15 can be found here The new Codeplex space is http identityservercodeplexcom  not published yet   IMAGE  </description><link>http://www.secuobs.com/revue/news/290977.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/290977.shtml</guid></item>
<item><title>StarterSTS 15</title><description>Secuobs.com : 2011-03-11 10:23:06 - www.leastprivilege.com -    I have the 15 version of StarterSTS sitting here for quite some time now But I was always reluctant to release it Some of the reasons are     too many new features for a single  small  version change    to many features that are optional, like bridged authentication and thus make the code very complex    the way I implemented Azure integration adds a dependency on the Azure SDK, even for  on-premise  installations I don t like that    the fact I am using some WebForms bits and some WCF bits, the URL structure got messy WebForms also don t help a lot in testability All of the above reasons together plus the fact that I am the only architect, developer and tester on this project made me come to the conclusion that I will cancel this release But wait     StarterSTS 15 is fully functional We use both the on-premise and Azure versions internally  in production     Cancelling means I will release the latest source code on Codeplex   but will not mark it as a  recommended release  I also won t produce updated screen casts and docs Bu the setup is very similar to earlier versions    Feel free to use and customize 15 and give me feedback On the good news front, I am working on a new version   welcome thinktecture IdentityServer This version is based on MVC3 and the routing architecture, removed a lot of the clutter, has a SQL CE4 based configuration system, is more extensible   and in overall just cleaner I will be able to upload CTPs very soon  IMAGE  </description><link>http://www.secuobs.com/revue/news/290960.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/290960.shtml</guid></item>
<item><title>Logging Output of Azure Startup Tasks to the Event Log</title><description>Secuobs.com : 2011-03-04 10:41:20 - www.leastprivilege.com -    This can come in handy when troubleshooting  using System  using SystemDiagnostics  using SystemText  namespace ThinktectureAzure   class Program   static EventLog _eventLog   new EventLog Application ,   ,  StartupTaskShell  static StringBuilder _out   new StringBuilder 64  static StringBuilder _err   new StringBuilder 64  static int Main string  args    if  argsLength   1    ConsoleWriteLine Invalid arguments      StringJoin ,  , args  _eventLogWriteEntry Invalid arguments      StringJoin ,  , args  return -1    var task   args 0  ProcessStartInfo info   new ProcessStartInfo    FileName   task, WorkingDirectory   EnvironmentCurrentDirectory, UseShellExecute   false, ErrorDialog   false, CreateNoWindow   true, RedirectStandardOutput   true, RedirectStandardError   true   var process   new Process  processStartInfo   info  processOutputDataReceived    s, e      if  eData   null    _outAppendLine eData      processErrorDataReceived    s, e      if  eData   null    _errAppendLine eData      processStart  processBeginOutputReadLine  processBeginErrorReadLine  processWaitForExit  var outString   _outToString  var errString   _errToString  if  stringIsNullOrWhiteSpace outString    outString   StringFormat Standard Out for  0 n n 1 , task, outString  _eventLogWriteEntry outString, EventLogEntryTypeInformation    if  stringIsNullOrWhiteSpace errString    errString   StringFormat Standard Err for  0 n n 1 , task, errString  _eventLogWriteEntry errString, EventLogEntryTypeError    return 0        You then wrap your startup tasks with the StartupTaskShell and you ll be able to see stdout and stderr in the application event log  IMAGE  </description><link>http://www.secuobs.com/revue/news/289387.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/289387.shtml</guid></item>
<item><title>Adding a Certificate to the Root Certificate Store from the Command Line  eg as an Azure Startup Task </title><description>Secuobs.com : 2011-03-01 16:11:46 - www.leastprivilege.com -    The title says it all   certutil -addstore root LeastPrivilegeCAcer  IMAGE  </description><link>http://www.secuobs.com/revue/news/288496.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/288496.shtml</guid></item>
<item><title>Windows Phone 7 and WS-Trust</title><description>Secuobs.com : 2011-02-25 09:55:14 - www.leastprivilege.com -    A question that I often hear these days is   Can I connect a Windows Phone 7 device to my existing enterprise services  Well   since most of my services are typically issued token based, this requires support for WS-Trust and WS-Security on the client Let s see what s necessary to write a WP7 client for this scenario  IMAGE  First I converted the Silverlight library that comes with the Identity Training Kit to WP7 Some things are not supported in WP7 WCF  like message inspectors and some client runtime hooks    but besides that this was a simple copy paste job Very nice  Next I used the WSTrustClient to request tokens from my STS  private WSTrustClient GetWSTrustClient    var client   new WSTrustClient  new WSTrustBindingUsernameMixed , new EndpointAddress https identitythinktecturecom issuesvc mixed username , new UsernameCredentials txtUserNameText, _txtPasswordPassword  return client    private void _btnLogin_Click object sender, RoutedEventArgs e    _client   GetWSTrustClient  var rst   new RequestSecurityToken WSTrust13ConstantsKeyTypesBearer    AppliesTo   new EndpointAddress https identitythinktecturecom rp    _clientIssueCompleted   client_IssueCompleted  _clientIssueAsync rst    I then used the returned RSTR to talk to the WCF service Due to a bug in the combination of the Silverlight library and the WP7 runtime   symmetric key tokens seem to have issues currently Bearer tokens work fine So I created the following binding for the WCF endpoint specifically for WP7                                                                            The binary encoding is not necessary, but will speed things up a little for mobile devices I then call the service with the following code  private       void    _btnCallService_Click    object    sender, RoutedEventArgs e    var    binding      new    CustomBinding  new    BinaryMessageEncodingBindingElement , new    HttpsTransportBindingElement  _proxy      new    StarterServiceContractClient  binding, new    EndpointAddress          using        var    scope      new    OperationContextScope proxyInnerChannel    OperationContextCurrentOutgoingMessageHeadersAdd    new    IssuedTokenHeader GlobalsRSTR  _proxyGetClaimsAsync      works download  IMAGE  </description><link>http://www.secuobs.com/revue/news/287638.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/287638.shtml</guid></item>
<item><title>Windows CardSpaceRIP</title><description>Secuobs.com : 2011-02-15 21:15:53 - www.leastprivilege.com -    http blogsmsdncom b card archive 2011 02 15 beyond-windows-cardspaceaspx  IMAGE  </description><link>http://www.secuobs.com/revue/news/285447.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/285447.shtml</guid></item>
<item><title>DevWeek 2011</title><description>Secuobs.com : 2011-01-31 09:46:43 - www.leastprivilege.com -    Grats to Nick for the biggest DevWeek ever  Looking forward to it   IMAGE  </description><link>http://www.secuobs.com/revue/news/281810.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/281810.shtml</guid></item>
<item><title>Get your annual reality check</title><description>Secuobs.com : 2011-01-26 08:47:03 - www.leastprivilege.com -    http wwwtroopersde   nuff said   be there    IMAGE  </description><link>http://www.secuobs.com/revue/news/280828.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/280828.shtml</guid></item>
<item><title>ThinktectureIdentityModel is now available from NuGet</title><description>Secuobs.com : 2011-01-21 13:30:36 - www.leastprivilege.com -    You can add my WIF helper library now via NuGet Simply type  Install-Package ThinktectureIdentityModel  into the Package Manager Console Or use the  Add Library Package Reference  dialog  IMAGE  </description><link>http://www.secuobs.com/revue/news/279859.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/279859.shtml</guid></item>
<item><title>StarterSTS 15 is now officially powered by Windows Azure</title><description>Secuobs.com : 2011-01-10 23:50:53 - www.leastprivilege.com -     and will be released soon    IMAGE   IMAGE  </description><link>http://www.secuobs.com/revue/news/277232.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/277232.shtml</guid></item>
<item><title>Windows Azure Root CAs and SSL Client Certificates</title><description>Secuobs.com : 2010-12-30 12:21:44 - www.leastprivilege.com -    I ran into some problems while trying to make SSL client certificates work for StarterSTS 15 In theory you have to do two things  via startup tasks     Unlock the SSL section in IIS    Install all the root certificates for the client certs you want to accept I did that But it still does not work While inspecting the event log, I stumbled over an schannel error message that I ve never seen before   When asking for client authentication, this server sends a list of trusted certificate authorities to the client The client uses this list to choose a client certificate that is trusted by the server Currently, this server trusts so many certificate authorities that the list has grown too long This list has thus been truncated The administrator of this machine should review the certificate authorities trusted for client authentication and remove those that do not really need to be trusted  WTF  And indeed standard Azure  web role  VMs trust 275 root CAs  see attached list  Including kinda obscure ones I don t really know why MS made this design decision It seems just wrong  including breaking the SSL client cert functionality  Deleting like 60pourcents of them made SSL client certs from my CA work So I guess I now have to find an automated way to attach CTLs to my site joy Exported list of trusted CA  as of 30th Dec 2010  AC Raíz Certicámara SA  4 2 2030 9 42 02 PM  AC RAIZ FNMT-RCM  1 1 2030 12 00 00 AM  A-CERT ADVANCED  10 23 2011 2 14 14 PM  Actalis Authentication CA G1  6 25 2022 2 06 00 PM  Agence Nationale de Certification Electronique  8 12 2037 9 03 17 AM  Agence Nationale de Certification Electronique  8 12 2037 9 58 14 AM  Agencia Catalana de Certificacio  NIF Q-0801176-I   1 7 2031 10 59 59 PM  America Online Root Certification Authority 1  11 19 2037 8 43 00 PM  America Online Root Certification Authority 2  9 29 2037 2 08 00 PM  ANCERT Certificados CGN  2 11 2024 5 27 12 PM  ANCERT Certificados Notariales  2 11 2024 3 58 26 PM  ANCERT Corporaciones de Derecho Publico  2 11 2024 5 22 45 PM  A-Trust-nQual-01  11 30 2014 11 00 00 PM  A-Trust-nQual-03  8 17 2015 10 00 00 PM  A-Trust-Qual-01  11 30 2014 11 00 00 PM  A-Trust-Qual-02  12 2 2014 11 00 00 PM  A-Trust-Qual-03a  4 24 2018 10 00 00 PM  Austria Telekom-Control Kommission  9 24 2005 12 40 00 PM  Austrian Society for Data Protection  2 12 2009 11 30 30 AM  Austrian Society for Data Protection GLOBALTRUST Certification Service  9 18 2036 2 12 35 PM  Autoridad Certificadora Raiz de la Secretaria de Economia  5 9 2025 12 00 00 AM  Autoridad de Certificacion de la Abogacia  6 13 2030 10 00 00 PM  Autoridad de Certificacion Firmaprofesional CIF A62634068  10 24 2013 10 00 00 PM  Autoridade Certificadora Raiz Brasileira  11 30 2011 11 59 00 PM  Baltimore CyberTrust Root  5 12 2025 11 59 00 PM  BIT AdminCA-CD-T01  1 25 2016 12 36 19 PM  BIT Admin-Root-CA  11 10 2021 7 51 07 AM  Buypass Class 2 CA 1  10 13 2016 10 25 09 AM  Buypass Class 3 CA 1  5 9 2015 2 13 03 PM  CA Disig  3 22 2016 1 39 34 AM  CertEurope  3 27 2037 11 00 00 PM  CERTICAMARA SA  2 23 2015 5 10 37 PM  Certicámara SA  5 23 2011 10 00 00 PM  Certigna  6 29 2027 3 13 05 PM  Certipost E-Trust Primary Normalised CA  7 26 2020 10 00 00 AM  Certipost E-Trust Primary Qualified CA  7 26 2020 10 00 00 AM  Certipost E-Trust Primary TOP Root CA  7 26 2025 10 00 00 AM  Certisign Autoridade Certificadora AC1S  6 27 2018 12 00 00 AM  Certisign Autoridade Certificadora AC2  6 27 2018 12 00 00 AM  Certisign Autoridade Certificadora AC3S  7 9 2018 8 56 32 PM  Certisign Autoridade Certificadora AC4  6 27 2018 12 00 00 AM  CertPlus Class 1 Primary CA  7 6 2020 11 59 59 PM  CertPlus Class 2 Primary CA  7 6 2019 11 59 59 PM  CertPlus Class 3 Primary CA  7 6 2019 11 59 59 PM  CertPlus Class 3P Primary CA  7 6 2019 11 59 59 PM  CertPlus Class 3TS Primary CA  7 6 2019 11 59 59 PM  CertRSA01  3 3 2010 2 59 59 PM  certSIGN Root CA  7 4 2031 5 20 04 PM  Certum  6 11 2027 10 46 39 AM  Certum Trusted Network CA  12 31 2029 12 07 37 PM  Chambers of Commerce Root - 2008  7 31 2038 12 29 50 PM  Chambersign Chambers of Commerce Root  9 30 2037 4 13 44 PM  Chambersign Global Root  9 30 2037 4 14 18 PM  Chambersign Public Notary Root  9 30 2037 4 14 49 PM  Chunghwa Telecom Co Ltd  12 20 2034 2 31 27 AM  Cisco Systems  5 14 2029 8 25 42 PM  CNNIC Root  4 16 2027 7 09 14 AM  Common Policy  10 15 2027 4 08 00 PM  COMODO  12 31 2028 11 59 59 PM  COMODO  1 18 2038 11 59 59 PM  COMODO  12 31 2029 11 59 59 PM  ComSign Advanced Security CA  3 24 2029 9 55 55 PM  ComSign CA  3 19 2029 3 02 18 PM  ComSign Secured CA  3 16 2029 3 04 56 PM  Correo Uruguayo - Root CA  12 31 2030 2 59 59 AM  Cybertrust Global Root  12 15 2021 8 00 00 AM  DanID  2 11 2037 9 09 30 AM  DanID  4 5 2021 5 03 17 PM  Deutsche Telekom Root CA 2  7 9 2019 11 59 00 PM  DigiCert  11 10 2031 12 00 00 AM  DigiCert  11 10 2031 12 00 00 AM  DigiCert  11 10 2031 12 00 00 AM  DigiNotar Root CA  3 31 2025 6 19 21 PM  DIRECCION GENERAL DE LA POLICIA  2 8 2036 10 59 59 PM  DST  ABAECOM  CA  7 9 2009 5 33 53 PM  DST  ANX Network  CA  12 9 2018 4 16 48 PM  DST  Baltimore EZ  CA  7 3 2009 7 56 53 PM  DST  National Retail Federation  RootCA  12 8 2008 4 14 16 PM  DST  United Parcel Service  RootCA  12 7 2008 12 25 46 AM  DST ACES CA X6  11 20 2017 9 19 58 PM  DST Root CA X3  9 30 2021 2 01 15 PM  DST RootCA X1  11 28 2008 6 18 55 PM  DST RootCA X2  11 27 2008 10 46 16 PM  DSTCA E1  12 10 2018 6 40 23 PM  DSTCA E2  12 9 2018 7 47 26 PM  DST-Entrust GTI CA  12 9 2018 12 32 24 AM  D-TRUST GmbH  5 16 2022 5 20 47 AM  D-TRUST GmbH  6 8 2012 11 47 46 AM  D-TRUST GmbH  5 16 2022 5 20 47 AM  EBG Elektronik Sertifika Hizmet Saglayicisi  8 14 2016 12 31 09 AM  E-Certchile  9 5 2028 7 39 41 PM  Echoworx Root CA2  10 7 2030 10 49 13 AM  ECRaizEstado  6 23 2030 1 41 27 PM  EDICOM  4 13 2028 4 24 22 PM  E-GÜVEN Elektronik Sertifika Hizmet Saglayicisi  1 4 2017 11 32 48 AM  E-ME SSI  RCA   5 19 2027 8 48 15 AM  Entrust  11 27 2026 8 53 42 PM  Entrust  5 25 2019 4 39 40 PM  Entrustnet  12 7 2030 5 55 54 PM  Equifax Secure eBusiness CA-1  6 21 2020 4 00 00 AM  Equifax Secure eBusiness CA-2  6 23 2019 12 14 45 PM  Equifax Secure Global eBusiness CA-1  6 21 2020 4 00 00 AM  eSign Australia  eSign Imperito Primary Root CA  5 23 2012 11 59 59 PM  eSign Australia  Gatekeeper Root CA  5 23 2014 11 59 59 PM  eSign Australia  Primary Utility Root CA  5 23 2012 11 59 59 PM  Fabrica Nacional de Moneda y Timbre  3 18 2019 3 26 19 PM  GeoTrust  8 22 2018 4 41 51 PM  GeoTrust  7 16 2036 11 59 59 PM  GeoTrust Global CA  5 21 2022 4 00 00 AM  GeoTrust Global CA 2  3 4 2019 5 00 00 AM  GeoTrust Primary Certification Authority - G2  1 18 2038 11 59 59 PM  GeoTrust Primary Certification Authority - G3  12 1 2037 11 59 59 PM  GeoTrust Universal CA  3 4 2029 5 00 00 AM  GeoTrust Universal CA 2  3 4 2029 5 00 00 AM  Global Chambersign Root - 2008  7 31 2038 12 31 40 PM  GlobalSign  1 28 2028 12 00 00 PM  GlobalSign  12 15 2021 8 00 00 AM  Go Daddy Class 2 Certification Authority  6 29 2034 5 06 20 PM  GTE CyberTrust Global Root  8 13 2018 11 59 00 PM  GTE CyberTrust Root  4 3 2004 11 59 00 PM  GTE CyberTrust Root  2 23 2006 11 59 00 PM  Halcom CA FO  6 5 2020 10 33 31 AM  Halcom CA PO 2  2 7 2019 6 33 31 PM  Hongkong Post Root CA  1 16 2010 11 59 00 PM  Hongkong Post Root CA 1  5 15 2023 4 52 29 AM  ICA První certifikacní autorita as  4 1 2018 12 00 00 AM  ICA První certifikacní autorita as  4 1 2018 12 00 00 AM  InfoNotary  3 6 2026 5 33 05 PM  IPS SERVIDORES  12 29 2009 11 21 07 PM  IZENPE SA  1 30 2018 11 00 00 PM  Izenpecom  12 13 2037 8 27 25 AM  Japan Certification Services, Inc SecureSign RootCA1  9 15 2020 2 59 59 PM  Japan Certification Services, Inc SecureSign RootCA11  4 8 2029 4 56 47 AM  Japan Certification Services, Inc SecureSign RootCA2  9 15 2020 2 59 59 PM  Japan Certification Services, Inc SecureSign RootCA3  9 15 2020 2 59 59 PM  Japan Local Government PKI Application CA  3 31 2016 2 59 59 PM  Japanese Government ApplicationCA  12 12 2017 3 00 00 PM  Juur-SK AS Sertifitseerimiskeskus  8 26 2016 2 23 01 PM  KamuSM  8 21 2017 11 37 07 AM  KISA RootCA 1  8 24 2025 8 05 46 AM  KISA RootCA 3  11 19 2014 6 39 51 AM  Macao Post eSignTrust  1 29 2013 11 59 59 PM  MicroSec e-Szigno Root CA  4 6 2017 12 28 44 PM  Microsoft Authenticode tm  Root  12 31 1999 11 59 59 PM  Microsoft Root Authority  12 31 2020 7 00 00 AM  Microsoft Root Certificate Authority  5 9 2021 11 28 13 PM  Microsoft Timestamp Root  12 30 1999 11 59 59 PM  MOGAHA Govt of Korea  4 21 2012 9 07 23 AM  MOGAHA Govt of Korea GPKI  3 15 2017 6 00 04 AM  NetLock Arany  Class Gold  Fotanúsítvány  12 6 2028 3 08 21 PM  NetLock Expressz  Class C  Tanusitvanykiado  2 20 2019 2 08 11 PM  NetLock Kozjegyzoi  Class A  Tanusitvanykiado  2 19 2019 11 14 47 PM  NetLock Minositett Kozjegyzoi  Class QA  Tanusitvanykiado  12 15 2022 1 47 11 AM  NetLock Platina  Class Platinum  Fotanúsítvány  12 6 2028 3 12 44 PM  NetLock Uzleti  Class B  Tanusitvanykiado  2 20 2019 2 10 22 PM  Netrust CA1  3 30 2021 2 57 45 AM  Network Solutions  12 31 2029 11 59 59 PM  NLB Nova Ljubljanska Banka dd Ljubljana  5 15 2023 12 22 45 PM  OISTE WISeKey Global Root GA CA  12 11 2037 4 09 51 PM  PostTrust Root CA  7 5 2022 9 12 33 AM  PostTrust Root CA  8 20 2010 1 56 21 PM  Posta CA Root  10 20 2028 12 52 08 PM  POSTarCA  2 7 2023 11 06 58 AM  QuoVadis Root CA 2  11 24 2031 6 23 33 PM  QuoVadis Root CA 3  11 24 2031 7 06 44 PM  QuoVadis Root Certification Authority  3 17 2021 6 33 33 PM  Root CA Generalitat Valenciana  7 1 2021 3 22 47 PM  RSA Security 2048 V3  2 22 2026 8 39 23 PM  SECOM Trust Systems CO LTD  6 6 2037 2 12 32 AM  SECOM Trust Systems CO LTD  6 25 2019 10 23 48 PM  SECOM Trust Systems CO LTD  9 30 2023 4 20 49 AM  Secretaria de Economia Mexico  5 8 2025 12 00 00 AM  Secrétariat Général de la Défense Nationale  10 17 2020 2 29 22 PM  SecureNet CA Class B  10 16 2009 9 59 00 AM  Serasa Certificate Authority I  11 21 2024 2 12 45 PM  Serasa Certificate Authority II  11 21 2024 12 44 48 PM  Serasa Certificate Authority III  11 21 2024 1 24 14 PM  SERVICIOS DE CERTIFICACION - ANC  3 9 2009 9 08 07 PM  Sigen-CA  6 29 2021 9 57 46 PM  Sigov-CA  1 10 2021 2 22 52 PM  Skaitmeninio sertifikavimo centras  12 28 2026 12 05 04 PM  Skaitmeninio sertifikavimo centras  12 25 2026 12 08 26 PM  Skaitmeninio sertifikavimo centras  12 22 2026 12 11 30 PM  Sonera Class1 CA  4 6 2021 10 49 13 AM  Sonera Class2 CA  4 6 2021 7 29 40 AM  Spanish Property   Commerce Registry CA  4 27 2012 9 39 50 AM  Staat der Nederlanden Root CA  12 16 2015 9 15 38 AM  Staat der Nederlanden Root CA - G2  3 25 2020 11 03 10 AM  Starfield Class 2 Certification Authority  6 29 2034 5 39 16 PM  Starfield Technologies  6 26 2019 12 19 54 AM  Starfield Technologies Inc  12 31 2029 11 59 59 PM  StartCom Certification Authority  9 17 2036 7 46 36 PM  S-TRUST Authentication and Encryption Root CA 2005 PN  6 21 2030 11 59 59 PM  Swisscom Root CA 1  8 18 2025 10 06 20 PM  SwissSign  10 25 2036 8 30 35 AM  SwissSign Platinum G2 Root CA  10 25 2036 8 36 00 AM  SwissSign Silver G2 Root CA  10 25 2036 8 32 46 AM  TC TrustCenter Class 1 CA  1 1 2011 11 59 59 AM  TC TrustCenter Class 2 CA  1 1 2011 11 59 59 AM  TC TrustCenter Class 2 CA II  12 31 2025 10 59 59 PM  TC TrustCenter Class 3 CA  1 1 2011 11 59 59 AM  TC TrustCenter Class 3 CA II  12 31 2025 10 59 59 PM  TC TrustCenter Class 4 CA  1 1 2011 11 59 59 AM  TC TrustCenter Class 4 CA II  12 31 2025 10 59 59 PM  TC TrustCenter Time Stamping CA  1 1 2011 11 59 59 AM  TC TrustCenter Universal CA I  12 31 2025 10 59 59 PM  TC TrustCenter Universal CA II  12 31 2030 10 59 59 PM  thawte  12 31 2020 11 59 59 PM  thawte  7 16 2036 11 59 59 PM  thawte  12 31 2020 11 59 59 PM  thawte  12 31 2020 11 59 59 PM  thawte  12 31 2020 11 59 59 PM  thawte  12 31 2020 11 59 59 PM  thawte  12 31 2020 11 59 59 PM  thawte Primary Root CA - G2  1 18 2038 11 59 59 PM  thawte Primary Root CA - G3  12 1 2037 11 59 59 PM  Thawte Timestamping CA  12 31 2020 11 59 59 PM  Trustis EVS Root CA  1 9 2027 11 56 00 AM  Trustis FPS Root CA  1 21 2024 11 36 54 AM  Trustwave  1 1 2035 5 37 19 AM  Trustwave  12 31 2029 7 40 55 PM  Trustwave  12 31 2029 7 52 06 PM  TURKTRUST Elektronik Islem Hizmetleri  9 16 2015 12 13 05 PM  TURKTRUST Elektronik Islem Hizmetleri  3 22 2015 10 04 51 AM  TURKTRUST Elektronik Sertifika Hizmet Saglayicisi  9 16 2015 10 07 57 AM  TURKTRUST Elektronik Sertifika Hizmet Saglayicisi  3 22 2015 10 27 17 AM  TÜRKTRUST Elektronik Sertifika Hizmet Saglayicisi  12 22 2017 6 37 19 PM  TW Government Root Certification Authority  12 5 2032 1 23 33 PM  TWCA Root Certification Authority 1  12 31 2030 3 59 59 PM  TWCA Root Certification Authority 2  12 31 2030 3 59 59 PM  US Government FBCA  10 6 2010 6 53 56 PM  UCA Global Root  12 31 2037 12 00 00 AM  UCA Root  12 31 2029 12 00 00 AM  USERTrust  7 9 2019 6 40 36 PM  USERTrust  7 9 2019 5 36 58 PM  USERTrust  6 24 2019 7 06 30 PM  USERTrust  7 9 2019 6 19 22 PM  USERTrust  5 30 2020 10 48 38 AM  UTN - USERFirst-Network Applications  7 9 2019 6 57 49 PM  ValiCert Class 3 Policy Validation Authority  6 26 2019 12 22 33 AM  VAS Latvijas Pasts SSI RCA   9 13 2024 9 27 57 AM  VeriSign  5 18 2018 11 59 59 PM  VeriSign  7 16 2036 11 59 59 PM  VeriSign  8 1 2028 11 59 59 PM  VeriSign  12 31 1999 9 37 48 AM  VeriSign  1 7 2004 11 59 59 PM  VeriSign  5 18 2018 11 59 59 PM  VeriSign  1 7 2004 11 59 59 PM  VeriSign  8 1 2028 11 59 59 PM  VeriSign  8 1 2028 11 59 59 PM  VeriSign  1 7 2020 11 59 59 PM  VeriSign  12 31 1999 9 35 58 AM  VeriSign  8 1 2028 11 59 59 PM  VeriSign  7 16 2036 11 59 59 PM  VeriSign  1 7 2004 11 59 59 PM  VeriSign  7 16 2036 11 59 59 PM  VeriSign  1 7 2010 11 59 59 PM  VeriSign  5 18 2018 11 59 59 PM  VeriSign  8 1 2028 11 59 59 PM  VeriSign  1 7 2004 11 59 59 PM  VeriSign  7 16 2036 11 59 59 PM  VeriSign  7 16 2036 11 59 59 PM  VeriSign  8 1 2028 11 59 59 PM  VeriSign  5 18 2018 11 59 59 PM  VeriSign Class 3 Public Primary CA  8 1 2028 11 59 59 PM  VeriSign Class 3 Public Primary Certification Authority - G4  1 18 2038 11 59 59 PM  VeriSign Time Stamping CA  1 7 2004 11 59 59 PM  VeriSign Universal Root Certification Authority  12 1 2037 11 59 59 PM  Visa eCommerce Root  6 24 2022 12 16 12 AM  Visa Information Delivery Root CA  6 29 2025 5 42 42 PM  VRK Gov Root CA  12 18 2023 1 51 08 PM  Wells Fargo Root Certificate Authority  1 14 2021 4 41 28 PM  WellsSecure Public Certificate Authority  12 14 2022 12 07 54 AM  Xcert EZ by DST  7 11 2009 4 14 18 PM   IMAGE  </description><link>http://www.secuobs.com/revue/news/274872.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/274872.shtml</guid></item>
<item><title>Windows Azure Diagnostics  Next to Useless </title><description>Secuobs.com : 2010-12-29 14:58:09 - www.leastprivilege.com -    To quote my good friend Christian   Tracing is probably one of the most discussed topics in the Windows Azure world Not because it is freaking cool   but because it can be very tedious and partly massively counter-intuitive   The NET Framework has this wonderful facility called TraceSource You define a named trace and route that to a configurable listener This gives you a lot of flexibility   you can create a single trace file   or multiple ones There is even nice tooling around that SvcTraceViewer from the SDK let s you open the XML trace files   you can filter and sort by trace source and event type, aggregate multiple files blablabla Just what you would expect from a decent tracing infrastructure Now comes Windows Azure I was already very grateful that starting with the SDK 12 we finally had a way to do tracing and diagnostics in the cloud  kudos  But the way the Azure DiagnosticMonitor is currently implemented   could be called flawed The Azure SDK provides a DiagnosticsMonitorTraceListener   which is the right way to go The only problem is, that way this works is, that all traces  from all sources  get written to an ETW trace Then the DiagMon listens to these traces and copies them periodically to your storage account So far so good But guess what happens to your nice trace files     the trace source names get  lost  They appear in your message text at the end So much for filtering and sorting and aggregating  regex  fail or  win     Every trace line becomes an entry in an Azure Storage Table   the svclog format is gone So much for the existing tooling To solve that problem, one workaround was to write your own trace listener   that creates svclog files inside of local storage and use the DiagMon to copy those Christian has a blog post about that OK done that Now it turns out that this mechanism does not work anymore in 13 with FullIIS  see here  Quoting   Some IIS 70 logs not collected due to permissions issuesThe root cause to both of these issues is the permissions on the log files  And the workaround   To read the files yourself, log on to the instance with a remote desktop connection  Now then have fun with your multi-instance deployments  So the bottom line is, that currently you cannot copy IIS logs, FREB logs and everything else that gets written by W3WP Nice    IMAGE  </description><link>http://www.secuobs.com/revue/news/274666.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/274666.shtml</guid></item>
<item><title>Unlocking the SSL Section in Windows Azure Web Roles</title><description>Secuobs.com : 2010-12-28 23:11:43 - www.leastprivilege.com -    Posting the favourite command line snippet seems to be the newest hobby for Azure developers   Here s one that is useful to unlock the SSL section  eg for client certificates  pourcentswindirpourcents System32 inetsrv appcmdexe unlock config  section systemwebServer security access  IMAGE  </description><link>http://www.secuobs.com/revue/news/274574.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/274574.shtml</guid></item>
<item><title>Handling Configuration Changes in Windows Azure Applications</title><description>Secuobs.com : 2010-12-25 08:54:21 - www.leastprivilege.com -    While finalizing StarterSTS 15, I had a closer look at lifetime and configuration management in Windows Azure  this is no new information   just some bits and pieces compiled at one single place   plus a bit of reality check  When dealing with lifetime management  and especially configuration changes , there are two mechanisms in Windows Azure   a RoleEntryPoint derived class and a couple of events on the RoleEnvironment class You can find good documentation about RoleEntryPoint here The RoleEnvironment class features two events that deal with configuration changes   Changing and Changed Whenever a configuration change gets pushed out by the fabric controller  either changes in the settings section or the instance count of a role  the Changing event gets fired The event handler receives an instance of the RoleEnvironmentChangingEventArgs type This contains a collection of type RoleEnvironmentChange This in turn is a base class for two other classes that detail the two types of possible configuration changes I mentioned above  RoleEnvironmentConfigurationSettingsChange  configuration settings  and RoleEnvironmentTopologyChange  instance count  The two respective classes contain information about which configuration setting and which role has been changed Furthermore the Changing event can trigger a role recycle  aka reboot  by setting EventArgsCancel to true So your typical job in the Changing event handler is to figure if your application can handle these configuration changes at runtime, or if you rather want a clean restart Prior to the SDK 13 VS Templates   the following code was generated to reboot if any configuration settings have changed  private void RoleEnvironmentChanging object sender, RoleEnvironmentChangingEventArgs e      If a configuration setting is changing if  eChangesAny change   change is RoleEnvironmentConfigurationSettingChange      Set eCancel to true to restart this role instance eCancel   true      This is a little drastic as a default since most applications will work just fine with changed configuration   maybe that s the reason this code has gone away in the 13 SDK templates  more  The Changed event gets fired after the configuration changes have been applied Again the changes will get passed in just like in the Changing event But from this point on RoleEnvironmentGetConfigurationSettingValue  will return the new values You can still decide to recycle if some change was so drastic that you need a restart You can use RoleEnvironmentRequestRecycle  for that  more  As a rule of thumb  When you always use GetConfigurationSettingValue to read from configuration  and there is no bigger state involved    you typically don t need to recycle In the case of StarterSTS, I had to abstract away the physical configuration system and read the actual configuration  either from webconfig or the Azure service configuration  at startup I then cache the configuration settings in memory This means I indeed need to take action when configuration changes   so in my case I simply clear the cache, and the new config values get read on the next access to my internal configuration object No downtime   nice  Gotcha A very natural place to hook up the RoleEnvironment lifetime events is the RoleEntryPoint derived class But with the move to the full IIS model in 13   the RoleEntryPoint methods get executed in a different AppDomain  even in a different process    see here You might no be able to call into your application code to eg clear a cache Keep that in mind  In this case you need to handle these events from eg globalasax  IMAGE  </description><link>http://www.secuobs.com/revue/news/274163.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/274163.shtml</guid></item>
<item><title>Update to DeployManager</title><description>Secuobs.com : 2010-12-24 13:08:27 - www.leastprivilege.com -    Raf did some updates to his tool It can now generate WIF WCF certificateReference sections Nice Blog post  http wwwiamrafnet Tools DeployManager-first-release-certificates-management Direct link  DeployManagerexe  IMAGE  </description><link>http://www.secuobs.com/revue/news/274065.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/274065.shtml</guid></item>
<item><title>5000 Downloads of StarterSTS</title><description>Secuobs.com : 2010-12-02 18:54:11 - www.leastprivilege.com -    nice   thanks for all the feedback and testing   IMAGE   IMAGE  </description><link>http://www.secuobs.com/revue/news/268898.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/268898.shtml</guid></item>
<item><title>TechEd 2010Architecting Claims-aware Applications</title><description>Secuobs.com : 2010-11-14 20:13:13 - www.leastprivilege.com -    Back from TechEd   was a blast   Here s the recording of my talk  http wwwmstechedcom 2010 Europe ARC303  IMAGE  </description><link>http://www.secuobs.com/revue/news/264754.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/264754.shtml</guid></item>
<item><title>StarterSTS v15 Beta 1</title><description>Secuobs.com : 2010-10-31 12:27:35 - www.leastprivilege.com -    I just uploaded a new drop of StarterSTS This release has many changes and new features, eg     Built-in support for Windows Azure    Caching    New REST endpoint    Federated Sign-Out    Extended tracing  including real time tracing to a WCF service and logging of RST R s and tokens  I will drill deeper into the new features in the forthcoming blog posts Please try it out and give me feedback  IMAGE  </description><link>http://www.secuobs.com/revue/news/261301.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/261301.shtml</guid></item>
<item><title>WIF, ADFS 2 and WCFPart 5  Service Client  more Flexibility with WSTrustChannelFactory </title><description>Secuobs.com : 2010-10-28 13:58:38 - www.leastprivilege.com -    See the previous posts first WIF includes an API to manually request tokens from a token service This gives you more control over the request and more flexibility since you can use your own token caching scheme instead of being bound to the channel object lifetime The API is straightforward You first request a token from the STS and then use that token to create a channel to the relying party service I d recommend using the WS-Trust bindings that ship with WIF to talk to ADFS 2   they are pre-configured to match the binding configuration of the ADFS 2 endpoints The following code requests a token for a WCF service from ADFS 2  private static SecurityToken GetToken      Windows authentication over transport security var factory   new WSTrustChannelFactory  new WindowsWSTrustBinding SecurityModeTransport , stsEndpoint  factoryTrustVersion   TrustVersionWSTrust13  var rst   new RequestSecurityToken   RequestType   RequestTypesIssue, AppliesTo   new EndpointAddress svcEndpoint , KeyType   KeyTypesSymmetric   var channel   factoryCreateChannel  return channelIssue rst    Afterwards, the returned token can be used to create a channel to the service Again WIF has some helper methods here that make this very easy  private static void CallService SecurityToken token      create binding and turn off sessions var binding   new WS2007FederationHttpBinding  WSFederationHttpSecurityModeTransportWithMessageCredential  bindingSecurityMessageEstablishSecurityContext   false    create factory and enable WIF plumbing var factory   new ChannelFactory binding, new EndpointAddress svcEndpoint  factoryConfigureChannelFactory    turn off CardSpace - we already have the token factoryCredentialsSupportInteractive   false  var channel   factoryCreateChannelWithIssuedToken token  channelGetClaims ForEach c   ConsoleWriteLine 0 n  1 n  2   3 n , cClaimType, cValue, cIssuer, cOriginalIssuer    Why is this approach more flexible  Well   some don t like the configuration voodoo That s a valid reason for using the manual approach You also get more control over the token request itself since you have full control over the RST message that gets send to the STS One common parameter that you may want to set yourself is the appliesTo value When you use the automatic token support in the WCF federation binding, the appliesTo is always the physical service address This means in turn that this address will be used as the audience URI value in the SAML token Well   this in turn means that when you have an application that consists of multiple services, you always have to configure all physical endpoint URLs in ADFS 2 and in the WIF configuration of the service s  Having control over the appliesTo allows you to use more symbolic realm names, eg the base address or a completely logical name Since the URL is never de-referenced you have some degree of freedom here In the next post we will look at the necessary code to request multiple tokens in a call chain This is a common scenario when you first have to acquire a token from an identity provider and have to send that on to a federation gateway or Resource STS Stay tuned  IMAGE  </description><link>http://www.secuobs.com/revue/news/260599.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/260599.shtml</guid></item>
<item><title>WIF, ADFS 2 and WCFPart 6  Chaining multiple Token Services</title><description>Secuobs.com : 2010-10-28 13:58:38 - www.leastprivilege.com -    See the previous posts first So far we looked at the  simpler  scenario where a client acquires a token from an identity provider and uses that for authentication against a relying party WCF service Another common scenario is, that the client first requests a token from an identity provider, and then uses this token to request a new token from a Resource STS or a partner s federation gateway This sounds complicated, but is actually very easy to achieve using WIF s WS-Trust client support The sequence is like this  1  Request a token from an identity provider You use some  bootstrap  credential for that like Windows integrated, UserName or a client certificate The realm used for this request is the identifier of the Resource STS federation gateway 2  Use the resulting token to request a new token from the Resource STS federation gateway The realm for this request would be the ultimate service you want to talk to 3  Use this resulting token to authenticate against the ultimate service Step 1 is very much the same as the code I have shown in the last post In the following snippet, I use a client certificate to get a token from my STS  private static SecurityToken GetIdPToken    var factory   new WSTrustChannelFactory  new CertificateWSTrustBinding SecurityModeTransportWithMessageCredential, idpEndpoint  factoryTrustVersion   TrustVersionWSTrust13  factoryCredentialsClientCertificateSetCertificate  StoreLocationCurrentUser, StoreNameMy, X509FindTypeFindBySubjectDistinguishedName,  CN Client  var rst   new RequestSecurityToken   RequestType   RequestTypesIssue, AppliesTo   new EndpointAddress rstsRealm , KeyType   KeyTypesSymmetric   var channel   factoryCreateChannel  return channelIssue rst    To use a token to request another token is slightly different First the IssuedTokenWSTrustBinding is used and second the channel factory extension methods are used to send the identity provider token to the Resource STS  private static SecurityToken GetRSTSToken SecurityToken idpToken    var binding   new IssuedTokenWSTrustBinding  bindingSecurityMode   SecurityModeTransportWithMessageCredential  var factory   new WSTrustChannelFactory  binding, rstsEndpoint  factoryTrustVersion   TrustVersionWSTrust13  factoryCredentialsSupportInteractive   false  var rst   new RequestSecurityToken   RequestType   RequestTypesIssue, AppliesTo   new EndpointAddress svcRealm , KeyType   KeyTypesSymmetric   factoryConfigureChannelFactory  var channel   factoryCreateChannelWithIssuedToken idpToken  return channelIssue rst    For this particular case I chose an ADFS endpoint for issued token authentication  see part 1 for more background  Calling the service now works exactly like I described in my last post You may now wonder if the same thing can be also achieved using configuration only   absolutely But there are some gotchas First of all the configuration files becomes quite complex As we discussed in part 4, the bindings must be nested for WCF to unwind the token call-stack But in this case svcutil cannot resolve the first hop since it cannot use metadata to inspect the identity provider This binding must be supplied manually The other issue is around the value for the realm appliesTo when requesting a token for the R-STS Using the manual approach you have full control over that parameter and you can simply use the R-STS issuer URI Using the configuration approach, the exact address of the R-STS endpoint will be used This means that you may have to register multiple R-STS endpoints in the identity provider Another issue you will run into is, that ADFS does only accepts its configured issuer URI as a known realm by default You d have to manually add more audience URIs for the specific endpoints using the ADFS Powershell commandlets I prefer the  manual  approach That s it Hope this is useful information  IMAGE  </description><link>http://www.secuobs.com/revue/news/260598.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/260598.shtml</guid></item>
<item><title>WIF, ADFS 2 and WCFPart 4  Service Client  more Flexibility with WSTrustChannelFactory </title><description>Secuobs.com : 2010-10-14 18:58:02 - www.leastprivilege.com -    See the previous posts first WIF includes an API to manually request tokens from a token service This gives you more control over the request and more flexibility since you can use your own token caching scheme instead of being bound to the channel object lifetime The API is straightforward You first request a token from the STS and then use that token to create a channel to the relying party service I d recommend using the WS-Trust bindings that ship with WIF to talk to ADFS 2   they are pre-configured to match the binding configuration of the ADFS 2 endpoints The following code requests a token for a WCF service from ADFS 2  private static SecurityToken GetToken      Windows authentication over transport security var factory   new WSTrustChannelFactory  new WindowsWSTrustBinding SecurityModeTransport , stsEndpoint  factoryTrustVersion   TrustVersionWSTrust13  var rst   new RequestSecurityToken   RequestType   RequestTypesIssue, AppliesTo   new EndpointAddress svcEndpoint , KeyType   KeyTypesSymmetric   var channel   factoryCreateChannel  return channelIssue rst    Afterwards, the returned token can be used to create a channel to the service Again WIF has some helper methods here that make this very easy  private static void CallService SecurityToken token      create binding and turn off sessions var binding   new WS2007FederationHttpBinding  WSFederationHttpSecurityModeTransportWithMessageCredential  bindingSecurityMessageEstablishSecurityContext   false    create factory and enable WIF plumbing var factory   new ChannelFactory binding, new EndpointAddress svcEndpoint  factoryConfigureChannelFactory    turn off CardSpace - we already have the token factoryCredentialsSupportInteractive   false  var channel   factoryCreateChannelWithIssuedToken token  channelGetClaims ForEach c   ConsoleWriteLine 0 n  1 n  2   3 n , cClaimType, cValue, cIssuer, cOriginalIssuer    Why is this approach more flexible  Well   some don t like the configuration voodoo That s a valid reason for using the manual approach You also get more control over the token request itself since you have full control over the RST message that gets send to the STS One common parameter that you may want to set yourself is the appliesTo value When you use the automatic token support in the WCF federation binding, the appliesTo is always the physical service address This means in turn that this address will be used as the audience URI value in the SAML token Well   this in turn means that when you have an application that consists of multiple services, you always have to configure all physical endpoint URLs in ADFS 2 and in the WIF configuration of the service s  Having control over the appliesTo allows you to use more symbolic realm names, eg the base address or a completely logical name Since the URL is never de-referenced you have some degree of freedom here In the next post we will look at the necessary code to request multiple tokens in a call chain This is a common scenario when you first have to acquire a token from an identity provider and have to send that on to a federation gateway or Resource STS Stay tuned  IMAGE  </description><link>http://www.secuobs.com/revue/news/257020.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/257020.shtml</guid></item>
<item><title>WIF, ADFS 2 and WCFPart 4  Service Client  using Service Metadata </title><description>Secuobs.com : 2010-10-14 17:09:13 - www.leastprivilege.com -    See parts 1, 2 and 3 first In this part we will finally build a client for our federated service There are basically two ways to accomplish this You can use the WCF built-in tooling to generate client and configuration via the service metadata  aka  Add Service Reference  This requires no WIF on the client side Another approach would be to use WIF s WSTrustChannelFactory to manually talk to the ADFS 2 WS-Trust endpoints This option gives you more flexibility, but is slightly more code to write You also need WIF on the client which implies that you need to run on a WIF supported operating system   this rules out eg Windows XP clients We ll start with the metadata way You simply create a new client project  eg a console app    call  Add Service Reference  and point the dialog to your service endpoint What will happen then is, that VS will contact your service and read its metadata Inside there is also a link to the metadata endpoint of ADFS 2 This one will be contacted next to find out which WS-Trust endpoints are available The end result will be a client side proxy and a configuration file Let s first write some code to call the service and then have a closer look at the config file var proxy   new ServiceClient  proxyGetClaims ForEach c   ConsoleWriteLine 0 n  1 n  2   3 n , cClaimType, cValue, cIssuer, cOriginalIssuer  That s all The magic is happening in the configuration file When you in inspect appconfig, you can see the following general configuration hierarchy      element with service endpoint information    federation binding and configuration containing    ADFS 2 endpoint 1  with binding and configuration     ADFS 2 endpoint n  with binding and configuration   where ADFS 2 endpoint 1 n are the endpoints I talked about in part 1  You will see a number of  elements in the binding configuration where simply the first endpoint from the ADFS 2 metadata becomes the default endpoint and all other endpoints and their configuration are commented out You now need to find the endpoint you want to use  based on trust version, credential type and security mode  and replace that with the default endpoint That s it When you call the WCF proxy, it will inspect configuration, then first contact the selected ADFS 2 endpoint to request a token This token will then be used to authenticate against the service In the next post I will show you the more manual approach using the WIF APIs  IMAGE  </description><link>http://www.secuobs.com/revue/news/256974.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/256974.shtml</guid></item>
<item><title>WIF, ADFS 2 and WCFPart 3  ADFS Setup</title><description>Secuobs.com : 2010-10-12 17:54:29 - www.leastprivilege.com -    In part 1 of this series I briefly gave an overview of the ADFS   WS-Trust infrastructure In part 2 we created a basic WCF service that uses ADFS for authentication This part will walk you through the steps to register the service in ADFS 2 I could provide screenshots for all the wizard pages here   but since this is really easy   I just go through the necessary steps in textual form Step 1   Select Data Source Here you can decide if you want to import a federation metadata file that describes the service you want to register In that case all necessary information is inside the metadata document and you are done FedUtil  a tool that ships with WIF  can generate such metadata for the most simple cases Another tool to create metadata can be found here We choose  Manual  here Step 2   Specify Display Name I guess that s self explaining Step 3   Choose Profile Choose  ADFS 2 Profile  here Step 4   Configure Certificate Remember that we specified a certificate  or rather a private key  to be used to decrypting incoming tokens in the previous post Here you specify the corresponding public key that ADFS 2 should use for encrypting the token Step 5   Configure URL This page is used to configure WS-Federation and SAML 20p support Since we are using WS-Trust you can leave both boxes unchecked Step 6   Configure Identifier Here you specify the identifier  aka the realm, aka the appliesTo  that will be used to request tokens for the service This value will be used in the token request and is used by ADFS 2 to make a connection to the relying party configuration and claim rules Step 7   Configure Issuance Authorization Rules Here you can configure who is allowed to request token for the service I won t go into details here how these rules exactly work   that s for a separate blog post For now simply use the  Permit all users  option OK   that s it The service is now registered at ADFS 2 In the next part we will finally look at the service client Stay tuned   IMAGE  </description><link>http://www.secuobs.com/revue/news/256200.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/256200.shtml</guid></item>
<item><title>WIF, ADFS 2 and WCFPart 2  The Service</title><description>Secuobs.com : 2010-10-11 21:04:16 - www.leastprivilege.com -    OK   so let s first start with a simple WCF service and connect that to ADFS 2 for authentication The service itself simply echoes back the user s claims   just so we can make sure it actually works and to see how the ADFS 2 issuance rules emit claims for the service   ServiceContract Namespace    urn leastprivilege samples  public interface IService    OperationContract  List GetClaims    public class Service   IService   public List GetClaims    var id   ThreadCurrentPrincipalIdentity as IClaimsIdentity  return  from c in idClaims select new ViewClaim   ClaimType   cClaimType, Value   cValue, Issuer   cIssuer, OriginalIssuer   cOriginalIssuer  ToList      The ViewClaim data contract is simply a DTO that holds the claim information Next is the WCF configuration   let s have a look step by step First I mapped all my http based services to the federation binding This is achieved by using NET 40 s protocol mapping feature  this can be also done the 3x way   but in that scenario all services will be federated     Next, I provide a standard configuration for the federation binding             This binding points to our ADFS 2 installation metadata endpoint This is all that is needed for svcutil  aka  Add Service Reference  to generate the required client configuration I also chose mixed mode security  SSL   basic message credential  for best performance This binding also disables session   you can control that via the establishSecurityContext setting on the binding This has its pros and cons Something for a separate blog post, I guess Next, the behavior section adds support for metadata and WIF          The next step is to add the WIF specific configuration  in   First we need to specify the key material that we will use to decrypt the incoming tokens This is optional for web applications but for web services you need to protect the proof key   so this is mandatory  at least for symmetric proof keys, which is the default     You also have to specify which incoming tokens you trust This is accomplished by registering the thumbprint of the signing keys you want to accept You get this information from the signing certificate configured in ADFS 2       The last step  promised  is to add the allowed audience URIs to the configuration   WCF clients use  by default   and we ll come back to this  the endpoint address of the service     OK   that s it   now we have a basic WCF service that uses ADFS 2 for authentication The next step will be to set-up ADFS to issue tokens for this service Afterwards we can explore various options on how to use this service from a client Stay tuned   if you want to have a look at the full source code or peek at the upcoming parts   you can download the complete solution here   IMAGE  </description><link>http://www.secuobs.com/revue/news/255930.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/255930.shtml</guid></item>
<item><title>WIF, ADFS 2 and WCFPart 1  Overview</title><description>Secuobs.com : 2010-10-11 17:12:46 - www.leastprivilege.com -    A lot has been written already about passive federation and integration of WIF and ADFS 2 into web apps The whole active WS-Trust feature area is much less documented or covered in articles and blogs Over the next few posts I will try to compile all relevant information about the above topics   but let s start with an overview ADFS 2 has a number of endpoints under the  services trust base address that implement the WS-Trust protocol They are grouped by the WS-Trust version they support  13 and  2005 , the client credential type  windows ,  username ,  certificate  and the security mode  transport,  mixed and message  You can see the endpoints in the MMC console under the Service Endpoints page So in other words, you use one of these endpoints  which exactly depends on your configuration   system setup  to request tokens from ADFS 2 The bindings behind the endpoints are more or less standard WCF bindings, but with SecureConversation  establishSecurityContext  disabled That means that whenever you need to programmatically talk to these endpoints   you can  easily  create client bindings that are compatible Another option is to use the special bindings that come with WIF  in the MicrosoftIdentityModelProtocolsWSTrustBindings namespace  They are already pre-configured to be compatible with the ADFS endpoints The downside of these bindings is, that you can t use them in configuration That s definitely a feature request of mine for the next version of WIF The next important piece of information is the so called Federation Service Identifier This is the value that you  at least by default  have to use as a realm appliesTo whenever you are requesting a token for ADFS  eg in IdP   RSTS scenario  Or  even more  technically speaking, ADFS 2 checks for this value in the audience URI restriction in SAML tokens You can get to this value by clicking the  Edit Federation Service Properties  in the MMC when the Service tree-node is selected OK   I will come back to this basic information in the following posts Basically I want to go through the following scenarios     ADFS in the IdP role    ADFS in the R-STS role  with a chained claims provider     Using the WCF bindings for automatic token issuance    Using WSTrustChannelFactory for manual token handling Stay tuned   IMAGE  </description><link>http://www.secuobs.com/revue/news/255875.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/255875.shtml</guid></item>
<item><title>Developer minded Certificate Management Tool</title><description>Secuobs.com : 2010-09-29 08:56:40 - www.leastprivilege.com -    Fellow Developer Security MVP Raffaele Rialdi just released a tool that makes common developer tasks related to certificate a little easier His tools eg supports setting ACLs on private keys, copying thumbprints and generating WCF  elements Nice work  Download here  IMAGE  </description><link>http://www.secuobs.com/revue/news/252693.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/252693.shtml</guid></item>
<item><title>BASTA </title><description>Secuobs.com : 2010-09-17 14:23:28 - www.leastprivilege.com -    Wir freuen uns alle schon riesig auf die BASTA  nächste Woche in Mainz Thinktecture ist dieses Mal vollständig vertreten und Christian, Jörg und ich haben ne nagelneue Demo-Anwendung, die wir am Freitag im Workshop zum ersten Mal öffentlich zeigen werden spannend  Thinktecture Timetable  http weblogsthinktecturecom cnagel 2010 08 bastahtml cu  IMAGE  </description><link>http://www.secuobs.com/revue/news/248845.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/248845.shtml</guid></item>
<item><title>StarterRP v12</title><description>Secuobs.com : 2010-09-17 01:39:32 - www.leastprivilege.com -    A small update for StarterRP is now live on codeplex This version is based on NET v4 and includes two sample Silverlight clients Major update to StarterSTS coming soon   IMAGE  </description><link>http://www.secuobs.com/revue/news/247527.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/247527.shtml</guid></item>
<item><title>Moving StarterSTS to the  Azure  Cloud</title><description>Secuobs.com : 2010-09-17 01:39:32 - www.leastprivilege.com -    Quite some people asked me about an Azure version of StarterSTS While I kinda knew what I had to do to make the move, I couldn t find the time Until recently This blog post briefly documents the necessary changes and design decisions for the next version of StarterSTS which will work both on-premise and on Azure Provider Fortunately StarterSTS is already based on the idea of  providers  Authentication, roles and claims generation is based on the standard ASPNET provider infrastructure This makes the migration to different data stores less painful In my case I simply moved the ASPNET provider database to SQL Azure and still use the standard SQL Server based membership, roles and profile provider In addition StarterSTS has its own providers to abstract resource access for certificates, relying party registration, client certificate registration and delegation So I only had to provide new implementations Signing and SSL keys now go in the Azure certificate store and user mappings  client certificates and delegation settings  have been moved to Azure table storage The one thing I didn t anticipate when I originally wrote StarterSTS was the need to also encapsulate configuration Currently configuration is  locked  to the standard NET configuration system The new version will have a pluggable SettingsProvider with versions for NET configuration as well as Azure service configuration If you want to externalize these settings into eg a database, it is now just a matter of supplying a corresponding provider Moving between the on-premise and Azure version will be just a matter of using different providers URL Handling Another thing that s substantially different on Azure  and load balanced scenarios in general  is the handling of URLs In farm scenarios, the standard APIs like ASPNET s RequestUrl return the current  internal  machine name, but you typically need the address of the external facing load balancer There s a hotfix for WCF 35  included in v4  that fixes this for WCF metadata This was accomplished by using the HTTP Host header to generate URLs instead of the local machine name I now use the same approach for generating WS-Federation metadata as well as information card files New Features I introduced a cache provider Since we now have slightly more expensive lookups  eg relying party data from table storage , it makes sense to cache certain data in the front end The default implementation uses the ASPNET web cache and can be easily extended to use products like memcached or AppFabric Caching Starting with the relying party provider, I now also provide a read write interface This allows building management interfaces on top of this provider I also include a  very  simple web page that allows working with the relying party provider data I guess I will use the same approach for other providers in the future as well I am also doing some work on the tracing and health monitoring area Especially important for the Azure version Stay tuned  IMAGE  </description><link>http://www.secuobs.com/revue/news/247526.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/247526.shtml</guid></item>
<item><title>Access Control Service v2</title><description>Secuobs.com : 2010-09-17 01:39:32 - www.leastprivilege.com -    A Resource-STS  others call it RP-STS or federation gateway  is a necessity for non-trivial federated identity scenarios ADFS v2 does an excellent job in fulfilling that role   but  as of now  you have to run ADFS on-premise The Azure Access Control Service is a Resource-STS in the cloud  with all the usual scalability availability  promises Unfortunately a lot of  the more interesting  features in ACS v1 had to be cut due to constrained time resources The good news is that ACS v2 is now in CTP and brings back a lot of the missing features  like WS  support  and adds some really sweet new ones  out of the box federation with Google, Facebook, LiveID   and OpenId in general  You can read about the details here On a related note   ACS v2 works out of the box with StarterSTS   simply choose the ADFS v2 option and point the management portal to the StarterSTS WS-Federation metadata endpoint Have fun    IMAGE  </description><link>http://www.secuobs.com/revue/news/247525.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/247525.shtml</guid></item>
<item><title>Fiddler Inspector for Federation Messages</title><description>Secuobs.com : 2010-09-17 01:39:32 - www.leastprivilege.com -    Fiddler is a very useful tool for troubleshooting all kinds of HTTP s  communications It also features various extensibility points to make it even more useful Using the inspector extensibility mechanism, I quickly knocked up an inspector for typical federation messages  thanks for Eric Lawrence btw  Below is a screenshot for WS-Federation  IMAGE  I also added support for SAML 20p request response messages   IMAGE  The inspector can be downloaded from the identitymodel Codeplex site Simply copy the binary to the inspector folder in the Fiddler directory  IMAGE  </description><link>http://www.secuobs.com/revue/news/247524.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/247524.shtml</guid></item>
<item><title>StarterSTS v15 CTP</title><description>Secuobs.com : 2010-09-17 01:39:32 - www.leastprivilege.com -    I just uploaded a new version of StarterSTS to Codeplex There have been some dramatic changes since the last public version, so any feedback would be appreciated This new version is now a NET 40 web application project, and includes all the necessary plumbing and configuration to deploy StarterSTS to Azure In fact it is just a configuration change to choose between the Azure and on-premise version Download  http starterstscodeplexcom releases view 52214 More info  Moving StarterSTS to the  Azure  Cloud  IMAGE  </description><link>http://www.secuobs.com/revue/news/247523.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/247523.shtml</guid></item>
<item><title>WIF, ASPNET 40 and Request Validation</title><description>Secuobs.com : 2010-07-24 11:42:22 - www.leastprivilege.com -    Since the response of a WS-Federation sign-in request contains XML, the ASPNET built-in request validation will trigger an exception To solve this, request validation needs to be turned off for pages receiving such a response message Starting with ASPNET 40 you can plug in your own request validation logic This allows letting WS-Federation messages through, while applying all standard request validation to all other requests The WIF SDK  v4  contains a sample validator that does exactly that  public class WSFedRequestValidator   RequestValidator   protected override bool IsValidRequestString  HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex    validationFailureIndex   0  if   requestValidationSource   RequestValidationSourceForm   collectionKeyEquals  WSFederationConstantsParametersResult, StringComparisonOrdinal       SignInResponseMessage message   WSFederationMessageCreateFromFormPost contextRequest  as SignInResponseMessage  if  message   null    return true      return baseIsValidRequestString  context, value, requestValidationSource, collectionKey, out validationFailureIndex       Register this validator via webconfig    IMAGE  </description><link>http://www.secuobs.com/revue/news/243541.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/243541.shtml</guid></item>
<item><title>StarterSTS v12</title><description>Secuobs.com : 2010-07-22 12:23:17 - www.leastprivilege.com -    I just uploaded version 12 of StarterSTS This is simply a conversion of v11 to a web application project Some people have asked for it so here we go This version is still compiled against NET 35 SP1   but this will the last release All upcoming releases will be NET 40 Codeplex Site  IMAGE  </description><link>http://www.secuobs.com/revue/news/242791.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/242791.shtml</guid></item>
<item><title>IIS  RESTful Services  FAIL</title><description>Secuobs.com : 2010-07-22 01:35:46 - www.leastprivilege.com -    really  when will super duper IIS finally support non-Windows accounts for HTTP authentication  http blogsmsdncom b astoriateam archive 2010 07 21 odata-and-authentication-part-6-custom-basic-authenticationaspx see here for a complete module including IIS management integration  http custombasicauthcodeplexcom  IMAGE  </description><link>http://www.secuobs.com/revue/news/242670.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/242670.shtml</guid></item>
<item><title>Re-MVPd 2010</title><description>Secuobs.com : 2010-07-20 09:53:05 - www.leastprivilege.com -    As always  thank you Microsoft   IMAGE  </description><link>http://www.secuobs.com/revue/news/241968.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/241968.shtml</guid></item>
<item><title>Modifying the SL WIF Integration Bits to support Issued Token Credentials</title><description>Secuobs.com : 2010-06-22 10:00:08 - www.leastprivilege.com -    The SL WIF integration code that ships with the Identity Training Kit only supports Windows and UserName credentials to request tokens from an STS This is fine for simple single STS scenarios  like a single IdP  But the more common pattern for claims token based systems is to split the STS roles into an IdP and a Resource STS  or whatever you wanna call it  In this case, the 2nd leg requires to present the issued token from the 1st leg   this is not directly supported by the bits But they can be easily modified to accomplish this The Credential Fist we need a class that represents an issued token credential Here we store the RSTR that got returned from the client to IdP request  public       class       IssuedTokenCredentials         IRequestCredentials      public       string    IssuedToken      get        set       public       RequestSecurityTokenResponse    RSTR      get        set       public    IssuedTokenCredentials    RequestSecurityTokenResponse    rstr    RSTR   rstr  IssuedToken   rstrRequestedSecurityTokenRawToken      The Binding Next we need a binding to be used with issued token credential requests This assumes you have an STS endpoint for mixed mode security with SecureConversation turned off public       class       WSTrustBindingIssuedTokenMixed         WSTrustBinding      public    WSTrustBindingIssuedTokenMixed    this   ElementsAdd     new       HttpsTransportBindingElement           WSTrustClient The last step is to make some modifications to WSTrustClient to make it issued token aware In the constructor you have to check for the credential type, and if it is an issued token, store it away private       RequestSecurityTokenResponse    _rstr  public    WSTrustClient     Binding    binding,    EndpointAddress    remoteAddress,  IRequestCredentials    credentials        base     binding, remoteAddress     if         null      credentials     throw       new       ArgumentNullException         credentials         if     credentials    is       UsernameCredentials       UsernameCredentials    usernname   credentials    as       UsernameCredentials     base   ChannelFactoryCredentialsUserNameUserName   usernnameUsername  base   ChannelFactoryCredentialsUserNamePassword   usernnamePassword    else       if     credentials    is       IssuedTokenCredentials       var    issuedToken   credentials    as       IssuedTokenCredentials     _rstr   issuedTokenRSTR    else       if     credentials    is       WindowsCredentials         else      throw       new       ArgumentOutOfRangeException        credentials    ,     type was not expected          Next   when WSTrustClient constructs the RST message to the STS, the issued token header must be embedded when needed  private       Message    BuildRequestAsMessage     RequestSecurityToken    request     var    message      Message   CreateMessage   base   EndpointBindingMessageVersion      MessageVersion   Default, IssueAction,     BodyWriter        new       WSTrustRequestBodyWriter     request     if     rstr      null       messageHeadersAdd    new       IssuedTokenHeader    rstr    return    message    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/233752.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/233752.shtml</guid></item>
<item><title>StarterSTS 11</title><description>Secuobs.com : 2010-06-10 11:37:08 - www.leastprivilege.com -    Earlier today I uploaded StarterSTS 11 and StarterRP 11 to codeplex I added identity delegation for internal as well as OpenID accounts and also updated StarterRP to show these features I also recorded an updated screencast on delegation since some of the config settings have changed since the CTP  IMAGE  </description><link>http://www.secuobs.com/revue/news/230335.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/230335.shtml</guid></item>
<item><title>Video of Moxie Marlinspikes More Tricks for Defeating SSL talk</title><description>Secuobs.com : 2010-05-27 14:38:43 - www.leastprivilege.com -    http wwwmefeediacom watch 26711228  IMAGE  </description><link>http://www.secuobs.com/revue/news/226248.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/226248.shtml</guid></item>
<item><title>Updated StarterSTS Documentation  Identity Delegation Screencast</title><description>Secuobs.com : 2010-05-26 11:18:46 - www.leastprivilege.com -    I recorded a short screencast describing the identity delegation feature in StarterSTS 11 You can watch it here I also uploaded an updated version of the documentation here  IMAGE  </description><link>http://www.secuobs.com/revue/news/225761.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/225761.shtml</guid></item>
<item><title>StarterSTS 11 CTP  ActAs Support</title><description>Secuobs.com : 2010-05-24 15:07:04 - www.leastprivilege.com -    Due to popular demand, I added identity delegation  aka ActAs  support to StarterSTS To give this feature a try, first download the new bits and add a enableActAs   true to starterstsconfig You then have to configure which user account is allowed to delegate, as well as the target realm to delegate to This is done in usermappingsconfig, eg          Please use the forum for any feedback thanks   IMAGE  </description><link>http://www.secuobs.com/revue/news/224997.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/224997.shtml</guid></item>
<item><title>A more elegant way of embedding a SOAP security header in Silverlight 4</title><description>Secuobs.com : 2010-05-14 07:54:34 - www.leastprivilege.com -    The current situation with Silverlight is, that there is no support for the WCF federation binding This means that all security token related interactions have to be done manually Requesting the token from an STS is not really the bad part, sending it along with outgoing SOAP messages is what s a little annoying So far you had to wrap all calls on the channel in an OperationContextScope wrapping an IContextChannel This  programming model  was a little disruptive  in addition to all the async stuff that you are forced to do  It seems that starting with SL4 there is more support for traditional WCF extensibility points   especially IEndpointBehavior, IClientMessageInspector I never read somewhere that these are new features in SL4   but I am pretty sure they did not exist in SL3 With the above mentioned interfaces at my disposal, I thought I have another go at embedding a security header   and yeah   I managed to make the code much prettier  and much less bizarre  Here s the code for the behavior inspector  public class IssuedTokenHeaderInspector   IClientMessageInspector   RequestSecurityTokenResponse _rstr  public IssuedTokenHeaderInspector RequestSecurityTokenResponse rstr    _rstr   rstr    public void AfterReceiveReply ref Message reply, object correlationState      public object BeforeSendRequest ref Message request, IClientChannel channel    requestHeadersAdd new IssuedTokenHeader rstr  return null      public class IssuedTokenHeaderBehavior   IEndpointBehavior   RequestSecurityTokenResponse _rstr  public IssuedTokenHeaderBehavior RequestSecurityTokenResponse rstr    if  rstr   null    throw new ArgumentNullException    _rstr   rstr    public void ApplyClientBehavior  ServiceEndpoint endpoint, ClientRuntime clientRuntime    clientRuntimeMessageInspectorsAdd new IssuedTokenHeaderInspector rstr      rest omitted   This allows to set up a proxy with an issued token header and you don t have to worry anymore with embedding the header manually with every call  var client   GetWSTrustClient  var rst   new RequestSecurityToken WSTrust13ConstantsKeyTypesSymmetric    AppliesTo   new EndpointAddress https rp    clientIssueCompleted    s, args      _proxy   new StarterServiceContractClient  _proxyEndpointBehaviorsAdd new IssuedTokenHeaderBehavior argsResult    clientIssueAsync rst  Since SL4 also support the IExtension interface, you can also combine this with Nicholas Allen s AutoHeaderExtension  IMAGE  </description><link>http://www.secuobs.com/revue/news/222109.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/222109.shtml</guid></item>
<item><title>ThinktectureIdentityModel  WRAP and SWT Support</title><description>Secuobs.com : 2010-05-10 00:39:58 - www.leastprivilege.com -    The latest drop of ThinktectureIdentityModel contains some helpers for the Web Resource Authorization Protocol  WRAP  and Simple Web Tokens  SWT  WRAP The WrapClient class is a helper to request SWT tokens via WRAP It supports issuer key, SWT and SAML input credentials, eg  var client   new WrapClient wrapEp  var swt   clientIssue issuerName, issuerKey, scope  All Issue overrides return a SimpleWebToken type, which brings me to the next helper class SWT The SimpleWebToken class wraps a SWT token It combines a number of features     conversion between string format and CLR type representation    creation of SWT tokens    validation of SWT token    projection of SWT token as IClaimsIdentity    helpers to embed SWT token in headers and query strings The following sample code generates a SWT token using the helper class  private static string CreateSwtToken    var signingKey    wA  var audience    http websample  var issuer    http self  var token   new SimpleWebToken  issuer, audience, ConvertFromBase64String signingKey  tokenAddClaim ClaimTypesName,  dominick  tokenAddClaim ClaimTypesRole,  Users  tokenAddClaim ClaimTypesRole,  Administrators  tokenAddClaim simple ,  test  return tokenToString     IMAGE  </description><link>http://www.secuobs.com/revue/news/220391.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/220391.shtml</guid></item>
<item><title>ThinktectureIdentityModel  Comparing Strings without leaking Timinig Information</title><description>Secuobs.com : 2010-05-08 22:47:36 - www.leastprivilege.com -    Paul Hill commented on a recent post where I was comparing HMACSHA256 signatures In a nutshell his complaint was that I am leaking timing information while doing so   or in other words, my code returned faster with wrong  or partially wrong  signatures than with the correct signature This can be potentially used for timing attacks like this one I think he got a point here, especially in the era of cloud computing where you can potentially run attack code on the same physical machine as your target to do high resolution timing analysis  see here for an example  It turns out that it is not that easy to write a time-constant string comparer due to all sort of  unexpected  clever optimization mechanisms in the CLR With the help and feedback of Paul and Shawn I came up with this     Structure the code in a way that the CLR will not try to optimize it    In addition turn off optimization  just in case a future version will come up with new optimization methods     Add a random sleep when the comparison fails  using Shawn s and Stephen s nice Random wrapper for RNGCryptoServiceProvider  You can find the full code in the ThinktectureIdentityModel download  MethodImpl MethodImplOptionsNoOptimization  public static bool IsEqual string s1, string s2    if  s1   null   s2   null    return true    if  s1   null  s2   null    return false    if  s1Length   s2Length    return false    var s1chars   s1ToCharArray  var s2chars   s2ToCharArray  int hits   0  for  int i   0  i  s1Length  i    if  s1chars i Equals s2chars i    hits   2    else   hits   1      bool same    hits   s1Length   2  if  same    var rnd   new CryptoRandom  ThreadSleep rndNext 0, 10    return same     IMAGE  </description><link>http://www.secuobs.com/revue/news/220287.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/220287.shtml</guid></item>
<item><title>ADFS 20 RTW</title><description>Secuobs.com : 2010-05-05 20:39:35 - www.leastprivilege.com -    Finally   the identity story is complete  for now  Download ADFS 20  IMAGE  </description><link>http://www.secuobs.com/revue/news/219181.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/219181.shtml</guid></item>
<item><title>ThinktectureIdentityModel  WIF Support for WCF REST Services and OData</title><description>Secuobs.com : 2010-05-05 18:00:55 - www.leastprivilege.com -    The latest drop of ThinktectureIdentityModel includes plumbing and support for WIF, claims and tokens for WCF REST services and Data Server  aka OData  Cibrax has an alternative implementation that uses the WCF Rest Starter Kit His recent post reminded me that I should finally  document  that part of our library Features include     generic plumbing for all WebServiceHost derived WCF services    support for SAML and SWT tokens    support for ClaimsAuthenticationManager and ClaimsAuthorizationManager    based solely on native WCF extensibility points  and WIF  This post walks you through the setup of an OData   WCF DataServices endpoint with token authentication and claims support This sample is also included in the codeplex download along a similar sample for plain WCF REST services Setting up the Data Service To prove the point I have created a simple WCF Data Service that renders the claims of the current client as an OData set public class ClaimsData   public IQueryable Claims   get   return GetClaims AsQueryable      private List GetClaims    var claims   new List  var identity   ThreadCurrentPrincipalIdentity as IClaimsIdentity  int id   0  identityClaimsToList ForEach claim     claimsAdd new ViewClaim   Id    id, ClaimType   claimClaimType, Value   claimValue, Issuer   claimIssuer     return claims       and hooked that up with a read only data service  public class ClaimsDataService   DataService   public static void InitializeService IDataServiceConfiguration config    configSetEntitySetAccessRule , EntitySetRightsAllRead      Enabling WIF Before you enable WIF, you should generate your client proxies Afterwards the service will only accept requests with an access token   and svcutil does not support that All the WIF magic is done in a special service authorization manager called the FederatedWebServiceAuthorizationManager This code checks incoming calls to see if the Authorization HTTP header  or X-Authorization for environments where you are not allowed to set the authorization header  contains a token This header must either start with SAML access_token  or WRAP access_token   for SAML or SWT tokens respectively  For SAML validation, the plumbing uses the normal WIF configuration For SWT you can either pass in a SimpleWebTokenRequirement or the SwtIssuer, SwtAudience and SwtSigningKey app settings are checkedIf the token can be successfully validated, ClaimsAuthenticationManager and ClaimsAuthorizationManager are invoked and the IClaimsPrincipal gets established The service authorization manager gets wired up by the FederatedWebServiceHostFactory  public class FederatedWebServiceHostFactory   WebServiceHostFactory   protected override ServiceHost CreateServiceHost  Type serviceType, Uri  baseAddresses    var host   baseCreateServiceHost serviceType, baseAddresses  hostAuthorizationServiceAuthorizationManager   new FederatedWebServiceAuthorizationManager  hostAuthorizationPrincipalPermissionMode   PrincipalPermissionModeCustom  return host      The last step is to set up the svc file to use the service host factory  see the sample download  Calling the Service To call the service you need to somehow get a token This is up to you You can either use WSTrustChannelFactory  for the full CLR , WSTrustClient  Silverlight  or some other way to obtain a token The sample also includes code to generate SWT tokens for testing   but the whole WRAP SWT support will be subject of a separate post I created some extensions methods for the most common web clients  WebClient, HttpWebRequest, DataServiceContext  that allow easy setting of the token, eg  public static void SetAccessToken this DataServiceContext context, string token, string type, string headerName    contextSendingRequest    s, e      eRequestHeaders headerName    GetHeader token, type      Making a query against the Data Service could look like this  static void CallService string token, string type    var data   new ClaimsData new Uri https server odatasvc  dataSetAccessToken token, type  dataClaimsToList ForEach c   ConsoleWriteLine 0 n  1 n  2 n , cClaimType, cValue, cIssuer    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/219093.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/219093.shtml</guid></item>
<item><title>ThinktectureIdentityModel  Claims Debugger Visualizer</title><description>Secuobs.com : 2010-05-05 15:27:30 - www.leastprivilege.com -    In the latest drop of ThinktectureIdentityModel you can find a debugger visualizer for IClaimsIdentity and IClaimsPrincipal  IMAGE  Have fun   PS Thanks to Mr UI  IMAGE  </description><link>http://www.secuobs.com/revue/news/219038.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/219038.shtml</guid></item>
<item><title>Sod This   reloaded</title><description>Secuobs.com : 2010-04-27 13:34:32 - www.leastprivilege.com -    Oliver and Gary fortunately decided to continue with their  Sod This  podcast show That s good   because I always found this very entertaining The  comeback  show is about security and identity   awesome    IMAGE  </description><link>http://www.secuobs.com/revue/news/216423.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/216423.shtml</guid></item>
<item><title>Using an Active Endpoint to sign into a Web Application</title><description>Secuobs.com : 2010-04-14 16:06:39 - www.leastprivilege.com -    This question comes up from time to time, so I thought I ll document it here The scenario is, that you don t want to do a passive redirect in a web app   but directly talk to an active STS endpoint to authenticate and request a token The reasons for that could be that you need a local sign-in page in the web app   or that the token service is not publicly reachable The following code can be used on a login page  protected void _btnLogin_Click object sender, EventArgs e      authenticate with WS-Trust endpoint var factory   new WSTrustChannelFactory  new UserNameWSTrustBinding SecurityModeTransportWithMessageCredential , new EndpointAddress https sts endpoint  factoryCredentialsUserNameUserName   _txtUserNameText  factoryCredentialsUserNamePassword   _txtPasswordText  var channel   factoryCreateChannel  var rst   new RequestSecurityToken   RequestType   RequestTypesIssue, AppliesTo   new EndpointAddress https rp , KeyType   KeyTypesBearer   var genericToken   channelIssue rst  as GenericXmlSecurityToken    parse token var handlers   FederatedAuthenticationServiceConfigurationSecurityTokenHandlers  var token   handlersReadToken new XmlTextReader  new StringReader genericTokenTokenXmlOuterXml  var identity   handlersValidateToken token First    create session token var sessionToken   new SessionSecurityToken  ClaimsPrincipalCreateFromIdentity identity  FederatedAuthenticationSessionAuthenticationModuleWriteSessionTokenToCookie sessionToken  ResponseRedirect users defaultaspx     IMAGE  </description><link>http://www.secuobs.com/revue/news/212061.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/212061.shtml</guid></item>
<item><title>Taken by Storm</title><description>Secuobs.com : 2010-04-06 13:05:47 - www.leastprivilege.com -    Any more dodgy puns  I am happy to announce that my good friend Oliver Sturm has joined thinktecture Oliver is a brilliant computer geek in general and a language wonk in particular   good company to hang out in bars   and just generally a nice guy Looking forward working with you   IMAGE  </description><link>http://www.secuobs.com/revue/news/209266.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/209266.shtml</guid></item>
<item><title>Thinktecture StarterSTS 10 RTW</title><description>Secuobs.com : 2010-04-04 09:19:10 - www.leastprivilege.com -    Wow   I can t tell you how happy and relieved I am to write this post   I started to work with what s now called WIF approximately two years ago   and built various security token services for customers, demos and internal use The idea behind StarterSTS was to have a non-trivial security token service sample that demonstrates the typical tasks of an STS  where it turns out that issuing tokens is by far the smallest part  and at the same time is real world enough to be directly used in specialized situations like development STSes I checked-in the first public version of StarterSTS at 25th May 2009 and had 1861 download so far Today I am announcing StarterSTS 10 which is feature complete  and hopefully reasonably bug-free  and finally includes documentation as well as nine new screencasts on the various feature areas I want to thank all beta-testers and early adopters that gave feedback along the way  Now that 10 is done we can think about ways to extend the STS in the future Codeplex Site http starterstscodeplexcom  main  http starterstscodeplexcom releases view 43054 DownloadId 115213  direct  http starterstscodeplexcom thread listaspx  forum  Documentation http identitythinktecturecom stsce docs  Screencasts   Initial setup   configuration   Federating your first web application   Federating with web services   Single-Sign-On   Confirmation screen   Using the REST endpoint   Using the OpenId bridge   Tracing   Using client certificates   Using Information Cards  IMAGE  </description><link>http://www.secuobs.com/revue/news/208743.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/208743.shtml</guid></item>
<item><title>Using Silverlight to Access WIF secured WCF Services  Part 3 </title><description>Secuobs.com : 2010-03-30 11:23:58 - www.leastprivilege.com -    In this last part of the series  see here and here  I want to show you how to use the WIF SL integration ClaimsIdentitySessionManager to request tokens and talk to WIF secured services The ClaimsIdentityManager registers as an ApplicationService in SL Once registered, it can encapsulate the process of requesting a token for a relying party, caching that token as well as setting the SOAP security header for outgoing service requests Registration ClaimsIdentitySessionManager gets registered in appxaml Here you can specify the endpoint address of the WS-Trust token services as well as the credential type In this sample I am using the ADFS2 Windows Transport endpoint from my last post        Calling the Service All the service interaction is abstracted by the ClaimsIdentitySessionManager The call to InvokeAsync does a few things     checks if a token has already been obtained for the service endpoint    if not, requests the token and caches it    if a password is required, invokes a callback to the UI    sets the SOAP security header using the requested token private void CallService    var factory   new ChannelFactory symmetric  var proxy   factoryCreateChannel  var channel   proxy as IClientChannel  ClaimsIdentitySessionManagerCurrentInvokeAsync      proxyBeginGetClaims result   ShowClaims proxy, result , null   , channel     IMAGE  </description><link>http://www.secuobs.com/revue/news/206816.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/206816.shtml</guid></item>
<item><title>Requesting Tokens from ADFS2 using Silverlight and Windows Authentication</title><description>Secuobs.com : 2010-03-28 18:20:04 - www.leastprivilege.com -    With SL4 s support for NTLM and the WIF integration bits, you can now easily request tokens from ADFS2  or any other token service that supports Windows authentication  in single-sign-on style Here s the quick walk-through  Enable the correct endpoint in ADFS2 You need a WS-Trust endpoint for version 13 that supports transport security and Windows authentication This endpoint needs to be enabled in the ADFS2 MMC  trust 13 windowstransport  Configure WSTrustClient and request the Token Next you have to configure WSTrustClient to use this endpoint, using the Windows binding and Windows credential type  var client   new WSTrustClient  new WSTrustBindingWindows , new EndpointAddress https server adfs services trust 13 windowstransport , new WindowsCredentials  From there on you can include the token to auth against other services  IMAGE  </description><link>http://www.secuobs.com/revue/news/206246.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/206246.shtml</guid></item>
<item><title>Using Silverlight to Access WIF secured WCF Services  Part 2 </title><description>Secuobs.com : 2010-03-21 23:22:27 - www.leastprivilege.com -    This was one of my most popular blog post in the recent time  please read it first to get the necessary background information  I thought I give this another shot with the new SL WIF integration There are other ways to accomplish the below things, eg using the SL application service or passive identity providers I am focusing here purely on the SL initiated active STS RP communication scenario and the raw APIs Requesting Tokens from within Silverlight In my old post I had to use a custom REST endpoint in StarterSTS to request a bearer token With the new WSTrustChannel, it is now possible to talk to a standard WS-Trust 13 endpoint  like the one in StarterSTS or ADFS2  var client   new WSTrustClient  new WSTrustBindingUsernameMixed , new EndpointAddress https  issuesvc mixed username , new UsernameCredentials username ,  password  You then have to construct an RST Basically you specify the key type  bearer or symmetric  and appliesTo value var rst   new RequestSecurityToken WSTrust13ConstantsKeyTypesSymmetric    AppliesTo   new EndpointAddress https roadie StarterRP    The call to WSTrustClientIssue returns an RSTR   which in turn contains the requested token and further key material The identity kit also contains a token cache called TokenCache You could use this class if you want to to store that token for further use clientIssueCompleted    s, args      _cacheAddTokenToCache myRP , argsResult    clientIssueAsync rst  Using a Token to authenticate with a WCF Relying Party Since Silverlight does not support issued token credentials, we must handcraft the SOAP security header The identity kit includes the IssuedTokenHeader class for this purpose The nice thing is, that this class supports symmetric proof keys as well as bearer tokens But you still have to set this header manually on every call The identity kit includes its own wrapper to abstract away the header generation I am using my own little helper here to make this process less disruptive public static class IssuedTokenHeaderExtensions   public static void SendWithIssuedToken this IContextChannel channel, RequestSecurityTokenResponse rstr, Action action    using  new OperationContextScope channel    OperationContextCurrentOutgoingMessageHeadersAdd  new IssuedTokenHeader rstr  action        This allows calling a WCF service like this  private void CallService    var factory   new ChannelFactory myRP  var proxy   factoryCreateChannel  var channel   proxy as IContextChannel  channelSendWithIssuedToken cacheGetTokenFromCache myRP ,       proxyBeginGetClaims result   ShowClaims proxy, result , null      The trick here again is, that the client stack is configured for no security at all, whereas the WCF service uses a federation binding  with SecureConversation turned off  I think this is pretty cool and solves some of the problems I had in the past If Silverlight would only support client certificate credentials   IMAGE  </description><link>http://www.secuobs.com/revue/news/203838.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/203838.shtml</guid></item>
<item><title>A first Look at Silverlight and WIF Integration</title><description>Secuobs.com : 2010-03-21 12:31:18 - www.leastprivilege.com -    At MIX, Caleb did a talk about the new Silverlight WIF integration classes that  ship  with the latest identity training kit Since this is a topic that comes up really frequently   I had a first look The integration code consists of two projects  client   server side plumbing  and can be divided into several feature areas I will post more information on the corresponding areas when I have written more code against them Same claims programming model as in WIF The integration code includes  I ClaimsPrincipal,  I ClaimsIdentity, Claim, ClaimCollection as well as the standard claim types WS-Trust and WS-Security support This is my favourite feature  The WSTrustClient class allows requesting tokens from WS-Trust 13 endpoints It supports Username Password and Windows credentials as well as bearer and symmetric token types The IssuedTokenHeader class makes it easier to embed the requested token in calls to backend services The TokenCache class allows caching RSTRs to be used with the issued token header Bringing claims to a Silverlight UI Another feature area deals with bringing claims into the SL UI for personalization and authorization purposes This needs some server side plumbing  the AuthenticationService  and seems to focus on passive scenarios The current implementation simply mirrors the user claims that are visible in the app service backend back to the UI Silverlight integration This part of the integration code makes logons and claims access more SLish by providing an SL appplication service and thus data binding access to claims HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/203793.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/203793.shtml</guid></item>
<item><title>ThinktectureDataObjectModel</title><description>Secuobs.com : 2010-03-09 12:00:55 - www.leastprivilege.com -    Our very own Jörg Neumann had this cooking for quite a while ttDOM is a library that lets you add features like change tracking, undo, redo, views, transactions and n-tier support to arbitrary types  or lists of types  This makes typical data scenarios in 3-tier applications  much  easier to handle Expect more information and documentation soon  of course   In the meanwhile feel free to play around with it and give us feedback via the codeplex forum  http dataobjectmodelcodeplexcom  IMAGE  </description><link>http://www.secuobs.com/revue/news/199696.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/199696.shtml</guid></item>
<item><title>This week  Trooper Heidelberg</title><description>Secuobs.com : 2010-03-07 19:33:01 - www.leastprivilege.com -    Looking forward to this week s nice little security conference organized by my old friends at ERNW Federated Identity - Opportunities and Risks The world is moving towards a federated identity model Public facing websites like Google or Facebook utilize technologies like OpenID, OAuth and WRAP to provide single-sign-on capabilities Enterprises and ISVs start deploying WS-Federation, WS-Trust and SAML to federate with customers, partners and even internally The goals are always the same  provide a more meaningful representation of  identity  for authentication, authorization and personalization This talks sheds light on all these technologies, how they work and how to secure them  IMAGE  </description><link>http://www.secuobs.com/revue/news/199159.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/199159.shtml</guid></item>
<item><title>WIF Workshop</title><description>Secuobs.com : 2010-03-05 14:55:57 - www.leastprivilege.com -    Mein geschätzter Kollege Vittorio Bertocci führt einen 2-Tägigen Workshop zum Thema Windows Identity Foundation in München durch Das ist bestimmt eine gute Gelegenheit sich mal abseits vom Projektalltag mit dem Thema genauer zu beschäftigen Wenn danach alle  un Klarheiten beseitigt sind, und Sie weiterführenden Informationen oder Unterstützung zur Implementierung von Claims in der Praxis benötigen   einfach Email an mich  dominickbaier  at_  thinktecturecom  Ich helfe gerne weiter Viel Spaß   IMAGE  </description><link>http://www.secuobs.com/revue/news/198655.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/198655.shtml</guid></item>
<item><title>Guide to Claims-based Identity and Access Control</title><description>Secuobs.com : 2010-03-05 14:55:57 - www.leastprivilege.com -    RTM finally    IMAGE  Book here Code here More info here Enjoy   IMAGE  </description><link>http://www.secuobs.com/revue/news/198654.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/198654.shtml</guid></item>
<item><title>Zurck von der BASTA</title><description>Secuobs.com : 2010-03-01 10:20:58 - www.leastprivilege.com -    So   zurück und  wichtiger  erholt von der BASTA Muss sagen   es war mal wieder sehr nett   großes Lob an Veranstalter und Teilnehmer Hat Spaß gemacht  Am meisten war ich über das große Interesse an WIF überrascht Ein voller Raum für nen Security Talk   und das direkt nach dem Essen   Hier habe ich eine sehr gute Zusammenfassung des Talks gefunden   die Punkte, die mir am Herzen lagen, scheinen angekommen zu sein  Das freut mich  Ich habe es schon während des Vortrags erwähnt   WIF ist sowohl ein neuer API als auch ein neues Paradigma Dafür reichen 75min einfach nicht aus Wer Fragen dazu hat, oder Unterstützung braucht   einfach Mail an mich Bis zum nächsten Mal   IMAGE  </description><link>http://www.secuobs.com/revue/news/196518.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/196518.shtml</guid></item>
<item><title>Adding StarterSTS as a Claims Provider for ADFS2</title><description>Secuobs.com : 2010-03-01 09:28:08 - www.leastprivilege.com -    The v1 beta of StarterSTS has an updated relying party configuration section This allows to  plugin  the STS into ADFS2 or Sharepoint as a claims provider Here s a quick walkthrough for ADFS2  Register StarterSTS as claims provider in ADFS This is really easy Simply go to the ADFS2 configuration console and add a new claims provider Then point the wizard to the StarterSTS WS-Federation metadata file  either by URL or using a file path  Afterwards you have to add some claim rules   to get started you could add a pass-through rule for the name claim You will also need to export the ADFS2 certificate that is used for token decryption Registering ADFS2 as a relying party in StarterSTS The next step is to register ADFS2 in StarterSTS This is done by modifying the relyingPartyconfig file  in the configuration sub folder  You need three things for that   the ADFS issuer URI, the physical address of the ADFS2 sign-in page and the ADFS2 token encryption certificate The certificate could be either imported into the certificate store or you copy it to  App_Data certificates The config entry looks similar to this   adfs services trust  replyTo https adfs ls    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/196504.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/196504.shtml</guid></item>
<item><title>WCF, WIF and Load Balancing  and a bit of Azure </title><description>Secuobs.com : 2010-02-19 10:14:39 - www.leastprivilege.com -    Pablo wrote a post yesterday giving some background information on how session tokens are protected in WIF   here some additional info for WCF  The ws  bindings in WCF establish a security session by default  via WS-SecureConversation  This has some implications, eg    You end up with a stateful service   or more important   with a stateful programming model You have all the typical session  problems  like faulted sessions, timeout, retries etc     By default SecureConversation only transmits a session identifier  like a ASPNET session cookie    the actual session is stored in-memory at the server Not good for load balancing When you want to use WCF in a load balanced environment  eg Azure    you have to change the default behavior   you basically have two options     Turn off SecureConversation all together This has the advantage of being stateless  at least in that part of the communication  But this also means, that the bootstrap  SAML  token will get parsed on every request   this includes invoking the ClaimsAuthenticationManager This might have performance implications   but depends on your scenario    Force WCF into  cookie mode  This means that the complete IClaimsPrincipal  after ClaimsAuthenticationManager has run  gets serialized and round-tripped in the SOAP header Turning off SecureConversation Unfortunately WCF 35 does not directly allow that on the standard federation bindings You would need to create a custom binding that uses an authentication mode of IssuedTokenOverTransport  for mixed mode  or IssuedTokenForCertificate  for message security  In NET 4 you can simply set establishSecurityContext to false on the standard ws-fed binding Cookie Mode Forcing WCF into cookie mode requires a custom binding The  trick  here is to set requireSecurityContextCancellation to false   which is just a fancy name for  serialize the context into the message  Here s the binding I am using  mixed mode security               As Pablo points out in his post, the session cookie must be protected somehow The standard WIF behavior is to the DPAPI user key This key cannot be easily shared between nodes in a cluster  unless the nodes are all domain members and roaming profiles are activated  Another more explicit  and practical  option is to use an RSA key Most typically you would feed your SSL certificate or the certificate used to decrypt incoming tokens into the following session token handler  public class WebFarmSessionSecurityTokenHandler   SessionSecurityTokenHandler   public WebFarmSessionSecurityTokenHandler X509Certificate2 protectionCertificate    base CreateRsaTransforms protectionCertificate      private static ReadOnlyCollection CreateRsaTransforms  X509Certificate2 protectionCertificate    var transforms   new List    new DeflateCookieTransform , new RsaEncryptionCookieTransform protectionCertificate , new RsaSignatureCookieTransform protectionCertificate ,   return transformsAsReadOnly      One way of wiring up the above handler would be a service host factory for the WIF enabled WCF service If you want to put a little more work in it you can also make the handler configuration friendly  see here  In general I d recommend watching Hervey s excellent talk from PDC09 about WIF in load balanced environments  eg Azure  HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/193472.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/193472.shtml</guid></item>
<item><title>Securing WCF Data Services using WIF</title><description>Secuobs.com : 2010-02-15 15:50:35 - www.leastprivilege.com -    This questions comes up every once in a while Since WCF Data Services is just a normal WCF service  using the web programming model , all the typical security APIs and extensibility points apply That said, depending on your scenario you might have to be a little more creative for REST-style services Here s a quick walkthrough  Enabling WIF in the Data Service The easiest way to get WIF wired up is by writing a custom service host factory You simply have to derive from DataServiceHostFactory, override CreateServiceHost and call FederatedServiceCredentialsConfigureServiceHost before you return the host to the plumbing This gives you the standard WIF integration for all standard HTTP credential types  Basic, Integrated etc  and the typical extensibility points like ClaimsAuthorizationManager For accepting and converting more advanced token types like SWT or SAML, you need to plugin your own token handling I gave it a try for SWT tokens  see here for the general SWT integration story  public class ProtectedDataServiceHostFactory   DataServiceHostFactory   protected override ServiceHost CreateServiceHost  Type serviceType, Uri  baseAddresses    hostAuthorizationServiceAuthorizationManager   new SimpleWebTokenAuthorizationManager  acsAddress, expectedAudience, acsKey  hostAuthorizationPrincipalPermissionMode   PrincipalPermissionModeCustom  return host      This uses my SWT plumbing to turn incoming SWT tokens into an IClaimsPrincipal You could easily do the same thing for SAML  but be aware that SAML tokens can become quite big   and you typically want to transmit them using an HTTP header for this scenario  You could now use the resulting claims for authorization as well as WCFDS interceptors, eg   QueryInterceptor Users  public Expression OnQueryUsers    var principal   ThreadCurrentPrincipal as IClaimsPrincipal  var customer   principalGetClaimValue http claims customerName  return user   userApplicationsApplicationName   customer    Sending a token header to the Data Service The next step is to send a token to the Data Service This can be achieved by handling the SendingRequest event on the DataServiceContext derived client plumbing, eg  class ProviderEntitiesWithToken   ProviderEntities   string _token  string _tokenHeader    Authorization  public ProviderEntitiesWithToken Uri address, string token    base address    _token   token  SendingRequest   OnSendingRequest    void OnSendingRequest object sender, SendingRequestEventArgs e    eRequestHeaders tokenHeader    SimpleWebTokenGetAuthorizationHeader token      Using the Data Service The usage pattern is the same as without any tokens or WIF New up your derived class, set the token and use eg LINQ to query the Data Service static void Main string  args    var token   RequestToken  var service   new ProviderEntitiesWithToken new Uri dataServiceAddress , token  var users   from u in serviceUsers select u  usersToList ForEach u   ConsoleWriteLine uUserName    HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/191967.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/191967.shtml</guid></item>
<item><title>Integrating Simple Web Tokens  SWT  with WCF REST Services using WIF</title><description>Secuobs.com : 2010-02-08 16:09:24 - www.leastprivilege.com -    The Simple Web Token  SWT  is a new   simple token format that was created by Microsoft, Google and others See here for specs The Azure platform App Fabric Access Control service eg uses this token type Why yet another token type  Well   the advantages of SWT are that it is simple to construct  form encoded key value pairs , that only simple crypto is needed  SHA256 HMACs  and that it is compact on the wire which allows easy embedding in HTTP headers or query strings The downsides are   it is not a widely adopted token format  current spec version is 0951  and the lack of asymmetric signatures  eg X509 based  Since I had to do some ACS work recently, I crafted up a simple SWT integration for WCF based REST services  works in ASPNET as well  The plumbing looks for a SWT token either on the Authorization or X-Authorization header as well as on the query string Using the power of WIF, it is simple to transform the SWT token into an IClaimsPrincipal From that point on, you have all the unified identity representation benefits of WIF Download here  IMAGE  </description><link>http://www.secuobs.com/revue/news/189618.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/189618.shtml</guid></item>
<item><title>Using SAML as a Client Credential Type in WCF  updated to WIF RTM </title><description>Secuobs.com : 2010-02-05 08:32:57 - www.leastprivilege.com -    A reader has asked me to update the Client SAML sample to WIF RTM  for background and motivation please read here first  The main work was in the SAML security token handler Validate method, this looks now like this  public override ClaimsIdentityCollection ValidateToken SecurityToken token    if  token   null    throw new ArgumentNullException token    var samlToken   token as SamlSecurityToken  if  samlToken   null    throw new ArgumentException token    if  samlTokenAssertion   null    throw new ArgumentException token    var assertion   samlTokenAssertion as Saml11Assertion  thisValidateConditions samlTokenAssertionConditions, false    extract claims from token var identity   new ClaimsIdentity ClientSaml  ProcessStatement assertionStatements, identity,  Client    call authentication and filtering logic IClaimsIdentity newIdentity  try   if  ValidateUser identity, out newIdentity    return new ClaimsIdentityCollection new IClaimsIdentity    newIdentity     else   throw new SecurityTokenValidationException Authentication failed      catch  Exception ex    throw new SecurityTokenValidationException Security token validation failed , ex      You would then derive from the base handler and implement the ValidateUser method This method does some sort of authentication based on the incoming claims and returns an IClaimsIdentity containing the claims that should get passed through to the service code, eg    sample implementation - do not use for production   protected override bool ValidateUser ClaimsIdentity id, out IClaimsIdentity newIdentity    newIdentity   null  var usernameClaim   idClaimsFirst c   cClaimType   WSIdentityConstantsClaimTypesName  var passwordClaim   idClaimsFirst c   cClaimType   _passwordClaimType  var customerIdClaim   idClaimsFirst c   cClaimType   _customerIdClaimType  if  usernameClaimValue   passwordClaimValue    newIdentity   new ClaimsIdentity new Claim    usernameClaim, customerIdClaim  ,  ClientSaml  return true    return false    You can find the complete source code here  IMAGE  </description><link>http://www.secuobs.com/revue/news/188885.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/188885.shtml</guid></item>
<item><title>StarterSTS V10 Beta 1</title><description>Secuobs.com : 2010-02-03 23:45:52 - www.leastprivilege.com -    OK   I finally was able to carve out some time This is the first feature complete release of the StarterSTS  New features include     client certificate support for WS-Fed and WS-Trust endpoints    new relying party configuration    allows specifying an explicit reply to address    allows relying parties without encryption    refactoring of web site   STS code Still no docs   sorry Please contact me via the Codeplex forum if you have any questions Some brief migration remarks     relying parties are now configured in relyingPartiesconfig Move the RP entries from certificatesconfig to this new config file    userMappingsconfig allows mapping client certificates to membership users    profile configuration has been moved to profileconfig On the todo list     documentation    simplified installation    IIS InetMgr integration for all configuration aspects What I need from you     testers     input and feedback    volunteers for completing the todos Have fun  download here  http starterstscodeplexcom Release ProjectReleasesaspx ReleaseId 39891  IMAGE  </description><link>http://www.secuobs.com/revue/news/188342.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/188342.shtml</guid></item>
<item><title>Testing Security Code with Moles</title><description>Secuobs.com : 2010-02-01 12:12:43 - www.leastprivilege.com -    I am by far no  unit  testing expert But I always found it odd that I sometimes have to re-structure code to make it explicitly unit-testable One typical example is code that relies on some sort of context   eg ThreadCurrentPrincipal I personally like this pattern in the NET Framework   but it is not ideal for testing Recently I ran across Moles which is a mocking and stubs framework from Microsoft Research which has some features that can help here Inspired by this video   I gave it a try The following code allows  faking  ThreadCurrentPrincipal  using SystemSecurityPrincipal  using SystemThreadingMoles  using MicrosoftMolesFramework  using MicrosoftVisualStudioTestToolsUnitTesting   assembly  MoledType typeof SystemThreadingThread  namespace SecurityTest    TestClass  public class UnitTest1    TestMethod   HostType Moles  public void TestSecurityCode    MThreadCurrentPrincipalGet       new GenericPrincipal new GenericIdentity dominick , null  var security   new SecurityCode  var user   securitySomeMethod  AssertAreEqual dominick , user      public class SecurityCode   public string SomeMethod      simulates context ThreadCurrentPrincipal   new GenericPrincipal  new GenericIdentity bob , null  return ThreadCurrentPrincipalIdentityName         IMAGE  </description><link>http://www.secuobs.com/revue/news/187251.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/187251.shtml</guid></item>
<item><title>A Guide to Claims-Based Identity and Access Control</title><description>Secuobs.com : 2010-02-01 10:10:07 - www.leastprivilege.com -    Get it here  http msdnmicrosoftcom en-us library ff359115aspx  IMAGE  </description><link>http://www.secuobs.com/revue/news/187210.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/187210.shtml</guid></item>
<item><title>Claims Identity Guide  Release Candidate</title><description>Secuobs.com : 2010-01-05 07:13:32 - www.leastprivilege.com -    The last six months we were working on finalizing the P P guide to claims based identity and access control We finally have a release candidate  Eugenio has all the details here As always, feedback is welcome  Enjoy   IMAGE  </description><link>http://www.secuobs.com/revue/news/178237.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/178237.shtml</guid></item>
<item><title>Beware of WIF HTTP Modules and Default Configuration</title><description>Secuobs.com : 2009-12-24 12:40:26 - www.leastprivilege.com -    Most samples I know of   as well as FedUtil generated configuration set a preCondition managedHandler  for the WIF HTTP modules This means that the modules  and thus the protection of the requested resource  only kicks in for  managed  content like aspx files Not for static content like xml etc If you like to protect static content using WIF, you have to remove the preCondition in webconfig Also add the runAllManagedModulesForAllRequests attribute to the modules section in systemwebServer if you are using ASPNET URL Authorization Subtle security hole   IMAGE  </description><link>http://www.secuobs.com/revue/news/175551.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/175551.shtml</guid></item>
<item><title>WIF Configuration  Part 3  Extensibility</title><description>Secuobs.com : 2009-12-24 10:22:53 - www.leastprivilege.com -    Some of the WIF configuration elements support extensibility This means that you can attach arbitrary XML child elements to the configuration elements When this is the case, the WIF configuration system creates the piece of plumbing in question using a special ctor that takes an XmlNodeList representing the custom configuration You can then parse the XML and configure the class accordingly Examples are  IssuerNameRegistry      ClaimsAuthorizationManager  see here       SecurityTokenHandler  see here      IMAGE  </description><link>http://www.secuobs.com/revue/news/175532.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/175532.shtml</guid></item>
<item><title>WIF Configuration  Part 2  SecurityTokenHandlerConfiguration</title><description>Secuobs.com : 2009-12-23 19:33:42 - www.leastprivilege.com -    The workhorse of WIF are security token handler Again token handler can be use independently of the WIF configuration system   or together The  stand-alone  use case You can simply new up a token handler  eg the SAML 11 handler  in an arbitrary application var saml11Handler   new Saml11SecurityTokenHandler  But a token handler needs more information to do its work  issuer name registry, audience URIs, certificate validation etc  This information is all encapsulated in the SecurityTokenHandlerConfiguration class You can reach into that class from the token handler s Configuration property Configuration is null by default and must be newed up and set manually Handler collections Another option is to group a bunch of token handlers into a collection This is useful when you have to deal with a number of in output token types or need to chain token handlers  eg for encryption or compression  Collections also allow to share token handler configuration across contained handlers When you new up a SecurityTokenHandlerCollection you have the choice of passing in a SecurityTokenHandlerConfiguration instance, or you use a default configuration  not sure if these values are documented   use reflector   When you add a handler to a collection, the collection checks if the handler already has some configuration set  by checking if Configuration is not null  If this is not the case, then handler inherits the collection configuration var samlHandlers   new SecurityTokenHandlerCollection new SecurityTokenHandler    saml11Handler, new Saml2SecurityTokenHandler    Another way to new up a handler collection is to use the static CreateDefaultSecurityTokenHandlerCollection method on the collection This creates a collection with all default token handlers shipping with WIF Again you have the option to pass in a configuration object Using configuration Token handler configuration is typically an ideal candidate for configuration files When you want to support that, you have two choices Either copy the values from configuration, or use the configuration system to create and configure the handler Copying from configuration can be handy sometimes To do that use the approach shown in my previous post to load the service configuration manually The WIF security token handler configuration section also has the concept of named handler collections There is always a default token handler collection, but you can have additional ones   each with their own configuration, eg                           Programmatically, you can get to the standard token handler collection using the SecurityTokenHandlers property on ServiceConfiguration To get to the named token handlers, you use the SecurityTokenHandlerCollectionManager, eg like this  var accessHandlers   configSecurityTokenHandlerCollectionManager AccessToken  So as a rule of thumb  when you new up handlers or collections yourself, you are responsible for programmatic configuration When you use ServiceConfiguration, the config file settings are applied automatically  IMAGE  </description><link>http://www.secuobs.com/revue/news/175372.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/175372.shtml</guid></item>
<item><title>WIF Configuration  Part 1  ServiceConfiguration</title><description>Secuobs.com : 2009-12-22 11:17:07 - www.leastprivilege.com -    WIF supports a flexible configuration system and various ways to programmatically interact with that configuration This flexibility comes in two ways     Named configuration elements that you can selectively load  service   token handler configuration     Configuration extensibility  eg for token handlers, issuer name registries or claims authorization  In this first part I ll focus on the service configuration The WIF configuration can have several service elements Services can be named, the unnamed element becomes the default configuration          You can get a handle to the configuration by newing up a ServiceConfiguration object The ctor allows to optionally pass in the name of the service From there on you have an OM that represents the various configuration options This is useful when you build your own integration, but for WCF and ASPNET there is already an infrastructure in place How to couple configuration with a relying party By default the standard hosting plumbing uses the default service configuration, but there are various ways to make this dynamic  eg for different environment like dev, staging etc  In ASPNET you can subscribe to the ServiceConfigurationCreated event of the FederatedAuthentication class This event gets fired during initialization and gives you the chance to load an arbitrary configuration and pass that back via the ServiceConfigurationCreatedEventArgs You can then access the current configuration at any point via FederatedAuthenticationServiceConfiguration  since creating a configuration is expensive, this class takes also care of caching  In WCF you wire up WIF with by calling FederatedServiceCredentialsConfigureServiceHost  This call allows you to either pass in an instance of ServiceConfiguration or the stringified name of the service Another option is to use the ConfigureServiceHostBehavior from configuration Again this behavior has a parameter called serviceName You can then access the current configuration either by    finding the FederatedServiceCredentials behavior from the ServiceHost description  if you have access to the ServiceHost     obtain it from a MessageProperty called ServiceConfiguration HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/174872.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/174872.shtml</guid></item>
<item><title>Troopers10</title><description>Secuobs.com : 2009-12-10 09:55:45 - www.leastprivilege.com -    The annual Troopers conference takes place in my home town   Heidelberg   this year nice   If you wanna know more about all things security wrt eg Blackberry, SSL TLS, outsourcing, rootkits, botnets, SAP, cloud computing, you name it This is the place to be I will do a talk about the opportunities and risks of federated identity See you there   IMAGE  </description><link>http://www.secuobs.com/revue/news/170526.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/170526.shtml</guid></item>
<item><title>Baier  Weyer on WIF</title><description>Secuobs.com : 2009-12-02 23:02:17 - www.leastprivilege.com -    We had the pleasure to have a chat with Richard and Carl about what s nearest and dearest to my heart   WIF   Enjoy  http wwwdotnetrockscom defaultaspx showNum 503  IMAGE  </description><link>http://www.secuobs.com/revue/news/167981.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/167981.shtml</guid></item>
<item><title>ThinktectureIdentityModel v06</title><description>Secuobs.com : 2009-11-26 17:46:39 - www.leastprivilege.com -    This version is compiled against WIF RTM Some stuff is still experimental But feel free to play around    IMAGE  </description><link>http://www.secuobs.com/revue/news/165534.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/165534.shtml</guid></item>
<item><title>IDFX to Zermatt to Geneva   to  WIF RTM </title><description>Secuobs.com : 2009-11-18 09:34:43 - www.leastprivilege.com -    It s been a long way  http msdnmicrosoftcom en-us evalcenter dd440951aspx I love it   IMAGE  </description><link>http://www.secuobs.com/revue/news/162473.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/162473.shtml</guid></item>
<item><title>StarterRP v095  for WIF RC </title><description>Secuobs.com : 2009-11-11 11:23:18 - www.leastprivilege.com -    Updated StarterRP to go with the 095 release of the StarterSTS Changes include     added more SOAP endpoints to the WCF RP    message, mixed mode, simple  for Silverlight clients     added a Silverlight client that can retrieve tokens and send them to RPs    added OpenID bridge test to the ASPNET RP Same disclaimer as here applies  IMAGE  </description><link>http://www.secuobs.com/revue/news/159728.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/159728.shtml</guid></item>
<item><title>StarterSTS v095  for WIF RC </title><description>Secuobs.com : 2009-11-10 21:38:26 - www.leastprivilege.com -    I uploaded an interim release of the StarterSTS to codeplex This release is not fully tested   and is mainly available to provide compatibility with WIF RC There are some new features   and I hope I have not introduced any regression bugs Please contact me via the codeplex forum when you have questions Some new features     added a simple HTTP and SOAP based endpoint to request token    added support to bridge OpenID logons to WS-Federation    you can specify a separate signing key for bridged authentication, so RPs can distinguish between native and bridged authentication    config changes to accomodate the various endpoints    WS-Trust  message security     WS-Trust  mixed mode security     simple HTTP    simple SOAP    OpenID bridge    WS-Federation metadata    did some refactoring to allow easier pluggability and customizations    retrieving certificates  CertificateProvider     retrieving claims  ClaimsProvider     analyzing an RST  PolicyOptions and PolicyScope     validating the request against configured policy  PolicyValidator     added optional confirmation screen after login    when enabled, the user has to confirm before StarterSTS issues the token    this is an additional countermeasure against one-click attacks Have fun  IMAGE  </description><link>http://www.secuobs.com/revue/news/159511.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/159511.shtml</guid></item>
<item><title>ThinktectureIdentityModel updated for WIF RC</title><description>Secuobs.com : 2009-11-08 14:17:04 - www.leastprivilege.com -    download here  IMAGE  </description><link>http://www.secuobs.com/revue/news/158670.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/158670.shtml</guid></item>
<item><title>Using Silverlight to Access WIF secured WCF Services</title><description>Secuobs.com : 2009-10-28 12:43:19 - www.leastprivilege.com -    This topic comes up quite often recently   so I hope the title is search engine friendly Disclaimer  At the time of this writing, the current version of Silverlight is v3 and WIF is in beta 2 Hopefully this will be a non-issue soon I talk a lot about claims, tokens and WIF ADFS 2 to customers All is good and fine and they like it Another technology that comes up very often is Silverlight   and especially the  story  of Silverlight and WCF WIF Now this is not an easy question to answer When thinking about Silverlight and back-end security in general   there are two fundamental scenarios   short of really good names   I call them  passive  and  active  Passive With passive I mean, that the browser has already established a security context with the back-end system the Silverlight XAP uses  and typically is also hosted at  An example would be that the user first authenticates with the web application and then starts the Silverlight app from there In this case all the authentication related work was done by browser beforehand and all back-end requests simply re-transmit authentication headers, cookies and the like This is not different with WIF secured ASPNET applications Eugenio has a good example of this here This approach works fine while running in the browser and using  application-local  resources only Active This is the scenario I really want to talk about In this case the XAP comes from some server down to the client  in or out-of-browser  and wants to communicate with some back-end service on a different machine This back-end service requires an issued token from a STS  IMAGE  Those of you with WCF background will say   that s what the federation bindings in WCF are for  But there is no federation binding in Silverlight If you need to enable such a scenario, you have to use several workarounds Requesting a Token Since Silverlight has no support for WS-Trust, we must find another way to request a token from a STS Thanks to WIF this is not hard to do when you control the token service You could add a simple REST or SOAP head that returns tokens I wrote about this approach here Some remarks here     Since you cannot do the proof of possession crypto in Silverlight, you need to request bearer tokens from the STS    The STS roundtrip is a cross-domain request This means that the STS needs a client access policy  see here     You have to somehow authenticate with the STS Silverlight has no support for Kerberos or client certificates Basically you are stuck with some kind of userid secret credential I wrote about that here Sending the token to the Service This is the slightly more complicated part Since Silverlight has no support for issued tokens, you have to manually embed the token in the outgoing SOAP security header This is not as scary as it sounds There is the so called Basic Security Profile in WS-Security which allows sending a simple security header with a timestamp and a token over SSL This can be encapsulated in a MessageHeader derived class public class SecurityMessageHeader   MessageHeader   string _token  string _nsUtility      public SecurityMessageHeader string token    _token   token    protected override void OnWriteHeaderContents  XmlDictionaryWriter writer, MessageVersion messageVersion    DateTime now   DateTimeUtcNow  string created   XmlConvertToString  now,  yyyy-MM-ddTHH mm ssfffZ  string expires   XmlConvertToString  nowAddMinutes 5 ,  yyyy-MM-ddTHH mm ssfffZ  writerWriteStartElement Timestamp , _nsUtility  writerWriteAttributeString Id , _nsUtility,  0  writerWriteElementString Created , _nsUtility, created  writerWriteElementString Expires , _nsUtility, expires  writerWriteEndElement  writerWriteNode XmlReaderCreate  new StringReader token , false    public override string Name   get   return  Security      public override string Namespace   get   return          Afterwards you can attach the header to outgoing calls  var factory   new ChannelFactory client  var proxy   factoryCreateChannel  using  var scope   new OperationContextScope proxy as IContextChannel    OperationContextCurrentOutgoingMessageHeadersAdd  new SecurityMessageHeader token  proxyBeginOperation result       , null    The binding on the client side is a binding with no client credential but SSL  the binary encoder is not required and used only for performance        On the service side, you need a binding that accepts bearer tokens over transport security, like this           The rest works as normal You have to enable WIF in the service and you get your IClaimsPrincipal Some remarks     Again this service needs a client access policy for Silverlight cross domain calls    Keep in mind that these are bearer tokens When you have a scenario that requires proof of possession, this will not work    The SOAP response from the service will also contain a security header Since the client is not configured for security this header may be unexpected Silverlight does not seem to care, but other web service stacks might In WCF you can work around that problem by adding the ValidateMustUnderstand behavior to the client stack The complete code  STS extensions, Silverlight client and back-end service  is included in the next drop of the StarterSTS  version 095  I will upload that soon HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/154819.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/154819.shtml</guid></item>
<item><title>ThinktectureIdentityModel</title><description>Secuobs.com : 2009-10-26 19:04:23 - www.leastprivilege.com -    Over the last years I have worked with several incarnations of what is now called the Windows Identity Foundation  WIF  Throughout that time I continuously built a little helper library that made common tasks easier to accomplish Now that WIF is near to its release, I put that library  now called ThinktectureIdentityModel  on Codeplex The library includes     Extension methods for    IClaimsIdentity, IClaimsPrincipal, IPrincipal    XmlElement, XElement, XmlReader    RSA, GenericXmlSecurityToken    Extensions to ClaimsAuthorizationManager  inspecting messages, custom principals     Logging extensions for SecurityTokenService    Simple STS  eg for REST     Helpers for WS-Federation message handling  eg as a replacement for the STS WebControl     Sample security tokens and security token handlers    simple access token with expiration    compressed security token    API and configuration section for easy certificate loading    Diagnostics helpers    ASPNET WebControl for invoking an identity selector  eg CardSpace  I have also added some samples and a rudimentary API documentation You can download the whole package identitymodelcodeplexcom Feel free to contact me via the forum when you have questions or found a bug  IMAGE  </description><link>http://www.secuobs.com/revue/news/154132.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/154132.shtml</guid></item>
<item><title>Guide to WCF Extensibility</title><description>Secuobs.com : 2009-10-17 15:20:48 - www.leastprivilege.com -    WCF extensibility is not trivial   this looks like it could become a very valuable source   IMAGE  </description><link>http://www.secuobs.com/revue/news/151484.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/151484.shtml</guid></item>
<item><title>StarterSTS, WIF, Identity on Channel9</title><description>Secuobs.com : 2009-10-08 15:01:34 - www.leastprivilege.com -    Dariusz interviewed me for Channel9 You can find the recording here Have fun    IMAGE  </description><link>http://www.secuobs.com/revue/news/148558.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/148558.shtml</guid></item>
<item><title>Claims based Identity  Access Control Guide  Early drafts available</title><description>Secuobs.com : 2009-10-05 12:01:21 - www.leastprivilege.com -    Eugenio just announced that the codeplex site is up now  Have a look at the draft documents   feedback is always welcome   IMAGE  </description><link>http://www.secuobs.com/revue/news/147440.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/147440.shtml</guid></item>
<item><title>Restful Token Service Endpoints and Silverlight Clients</title><description>Secuobs.com : 2009-09-13 18:16:54 - www.leastprivilege.com -    It turns out that there is no way in Silverlight to send credentials using the standard HTTP Authorize header  see here  WTF  You have to use a custom HTTP header to transmit credentials in this case, eg X-Authorize  nice  I have adjusted my service code to accept both headers and will update the StarterSTS bits on Codeplex  IMAGE  </description><link>http://www.secuobs.com/revue/news/140498.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/140498.shtml</guid></item>
<item><title>StarterSTS Version 093</title><description>Secuobs.com : 2009-09-12 01:33:06 - www.leastprivilege.com -    I just uploaded a minor update    refactored ScopeOptions to PolicyOptions and added a PolicyScope class    CertificateProvider class abstracts physical loading of relying party encryption certificates     users restIssuesvc is a Restful token issuance endpoint   you can use a simple GET to retrieve a token  see here  btw   this is the client code you can use to talk to the REST issuance endpoint  public static string GetToken  string username, string password, string uri, string realm    using  var client   new WebClient    var encoding   EncodingGetEncoding iso-8859-1  string encodedCreds   ConvertToBase64String  encodingGetBytes StringFormat 0 1 , username, password  string authHeader   stringFormat Basic  0 , encodedCreds  realm   HttpUtilityUrlEncode realm  clientHeadersAdd HttpRequestHeaderAuthorization, authHeader  return clientDownloadString  stringFormat 0 realm 1 , uri, realm       IMAGE  </description><link>http://www.secuobs.com/revue/news/140238.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/140238.shtml</guid></item>
<item><title>Adding a REST Endpoint to a WIF Token Service</title><description>Secuobs.com : 2009-09-11 14:02:48 - www.leastprivilege.com -    Sometimes it is useful to have a really simple way to acquire a token from a token service   without having to fiddle around with WS-Federation or WS-Trust Issuing a simple GET request against a token issuance endpoint seems to fulfill that requirement So I decided to a add a simple HTTP endpoint to my STS using the WCF web programming model   ServiceContract  public interface IRestfulTokenServiceContract    OperationContract   WebGet UriTemplate    realm realm  XElement Issue string realm    You could provide more parameters here  like token type, lifetime etc  but i decided to keep it simple For the implementation you have to decide which authentication types you want to support Since I needed username password authentication I used Cibrax  excellent basic authentication extension If you need to support client certificates, you would get the certificate details from WCF s AuthorizationContext To route the GET request to the existing token issuance logic, you can create the STS using the static CreateSecurityTokenService method on the SecurityTokenServiceConfiguration class Then you have to construct a RST and IClaimsPrincipal to describe the token request and pass that into the Issue method Afterwards you serialize the security token back as a HTTP response and you are done I will incorporate that into the next drop of the StarterSTS   but for now here is the code  public class RestfulTokenService   IRestfulTokenServiceContract   public XElement Issue string realm    EndpointAddress epRealm  try   epRealm   new EndpointAddress realm    catch   WebOperationContextCurrentOutgoingResponseStatusCode   HttpStatusCodeBadRequest  return null    RequestSecurityToken rst   new RequestSecurityToken   AppliesTo   epRealm, KeyType   KeyTypeConstantsBearer   var sts   new StarterTokenServiceConfiguration CreateSecurityTokenService  var rstr   stsIssue CreatePrincipal , rst  StringBuilder sb   new StringBuilder  var writer   XmlWriterCreate sb  var col   SecurityTokenHandlerCollectionCreateDefaultSecurityTokenHandlerCollection  colWriteSecurityToken writer, rstrRequestedSecurityTokenSecurityToken  writerFlush  WebOperationContextCurrentOutgoingResponseContentType    text xml  return XElementParse sbToString    private IClaimsPrincipal CreatePrincipal    if  ThreadCurrentPrincipal   null  ThreadCurrentPrincipalIdentity   null  stringIsNullOrEmpty ThreadCurrentPrincipalIdentityName    throw new InvalidRequestException unknown client    var identity   new ClaimsIdentity  new Claim WSIdentityConstantsClaimTypesName, ThreadCurrentPrincipalIdentityName  return new ClaimsPrincipal identity     IMAGE  </description><link>http://www.secuobs.com/revue/news/140026.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/140026.shtml</guid></item>
<item><title>StarterSTS Version 092</title><description>Secuobs.com : 2009-09-01 16:51:25 - www.leastprivilege.com -    I have an update to the StarterSTS up on codeplex There is also a new screencast that details the changes from the last version Have fun   IMAGE  </description><link>http://www.secuobs.com/revue/news/136542.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/136542.shtml</guid></item>
<item><title>NET Usergroup Frankfurt  WIF, ADFS 2, CardSpace 2</title><description>Secuobs.com : 2009-08-29 01:06:35 - www.leastprivilege.com -    Am 15 September sind Christian und Ich in Frankfurt und plaudern mal nen Abend lang über unsere Erfahrungen mit Identity und Claims in verteilten Anwendungen Wir freuen uns schon und das sollte ein netter Abend werden Es sind noch Plätze frei   Anmeldung ist hier erforderlich Vielleicht sieht man sich ja dort  IMAGE  </description><link>http://www.secuobs.com/revue/news/135753.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/135753.shtml</guid></item>
<item><title>Patterns  Practices - Claims based Authentication  Authorization Guide</title><description>Secuobs.com : 2009-08-24 13:25:02 - www.leastprivilege.com -    Summer break is over   and exciting times lie ahead Over the course of the next months I will be working with Eugenio, Keith, Vittorio, Matias and David The end result will  hopefully  be a very interesting, useful and pragmatic guide to all things claims Eugenio already posted some details on the guide and we will be releasing interim version so you can give us feedback Watch this space   IMAGE  </description><link>http://www.secuobs.com/revue/news/133694.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/133694.shtml</guid></item>
<item><title>WCF Source Code for Download</title><description>Secuobs.com : 2009-07-30 08:06:27 - www.leastprivilege.com -    http referencesourcemicrosoftcom netframeworkaspx  IMAGE  </description><link>http://www.secuobs.com/revue/news/126447.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/126447.shtml</guid></item>
<item><title>Claims Authorization in WIF Beta 2  ASPNET and WCF Integration</title><description>Secuobs.com : 2009-07-27 15:09:52 - www.leastprivilege.com -    In the previous post I illustrated how the basic claims authorization infrastructure in WIF  formerly Geneva  works In this post I want to focus more on how claims authorization behaves when integrated in WCF and ASPNET ASPNET In addition to using the claims authorization manager manually like I showed you in the last post, you can also opt-in to per-request claims authorization  think of it as a replacement for the  classic  URL authorization module in ASPNET   IIS  For this purpose you ll find an HTTP module called ClaimsAuthorizationModule in the MicrosoftIdentityModelWeb namespace This module simply subscribes to the AuthorizeRequest processing stage and calls the configured claims authorization manager for every request The AuthorizationContext that gets passed in the manager consists of the current IClaimsPrincipal, the request URL and the HTTP method If you want to do tricks like custom IClaimsPrincipal implementations, you d either exchange the principal before you hit the claims authorization manager  in PostAuthenticateRequest  or after it  in PostAuthorizeRequest  WCF As usual things are a little more complex in WCF Authorization  amongst other things  is driven by a ServiceAuthorizationManager in WCF When you call ConfigureServiceHost, WIF puts a special version of that class, the IdentityModelServiceAuthorizationManager, in place This class in turn calls out to the configured ClaimsAuthorizationManager In that case the WS-Addressing To and the Action header are passed in for every request HTH  IMAGE  </description><link>http://www.secuobs.com/revue/news/125307.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/125307.shtml</guid></item>
<item><title>Defeating SSL</title><description>Secuobs.com : 2009-07-10 18:34:08 - www.leastprivilege.com -    Not a really new paper – but definitely recommended readingSome lessons learned:*  Moxie is not really attacking SSL – but uses HTTP to bypassHTTPS*  Switch to SSL as early as possible – but that might be too latealready*  Users never type https:// nor http:// – they start with plaintext and hope the application is doing the right thing*  Fortunately web services are not affected There is no humandoing the http vs https decision WCF eg also doesn’t like to bedowngraded to plain text whenever credentials are involved That’sa good thing in the face of such attacks*  Endpoint Identities an addition to WS-Addressing are a goodthingI see interesting times for passive profile SSO scenarios likeWS-Federation This doesn’t mean that these technologies open newholes – it is just that the username/password credentials we sendaround are much more powerful because they can be used in multipleapplicationsThis also means – if you are building a passive STS – you should notsolely rely on SSL to secure your tokens Encrypt themIMAGE</description><link>http://www.secuobs.com/revue/news/118917.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/118917.shtml</guid></item>
<item><title>Claims Authorization in Geneva Beta 2 - Introduction</title><description>Secuobs.com : 2009-07-10 18:34:08 - www.leastprivilege.com -    I guess you already heard the term “claims based authorization”several times by now But how exactly does the authorization workThe typical pattern is that you iterate through the claims associatedwith the user and search for a special claim and maybe also a specialvalue of that claim Based on that you can grant/deny access or modifybehavior or UI elementsThis typically leads to code like this:if principalClaimExists"http://someclaim", "somevalue" {}orprincipalDemandClaimWSAuthorizationConstantsAction, "AddCustomer";This has the downside, that claim types and values are embedded inyour application code and this may become hard to maintain in certainsituations That’s the reason why the Geneva framework Beta 2introduced a built-in infrastructure for authorization that operatesat a higher level of abstractionIn Geneva authorization information is abstracted as a resource thatthe subject tries to access and the action the subject wants toperform on that resource The container for this information is calledthe AuthorizationContextOperation and action are collections of claims This allows to expressfrom simple to more complicated authorization statements A simpleresource/action pair could be eg Directory/Browse A morecomplicated statement could be eg “Purge printer queue of laserprinter in building 61”That’s how you could construct the corresponding AuthorizationContext:var simpleContext = new AuthorizationContextprincipal, "Directory","Browse";andvar advContext = new AuthorizationContextprincipal,new Collection{new Claim"http://claims/device", "Printer",new Claim"http://claims/building", "61"},new Collection{new ClaimWSAuthorizationConstantsAction, "PurgeQueue"};The second piece of plumbing introduced by Geneva is theClaimsAuthorizationManager You derive from this class and implementthe CheckAccess method This method accepts an AuthorizationContextand returns true/false In this method you have to do whatever mappingis necessary to resolve the resource/action pair to claims of thesubjectUse this sample authorization manager to inspect the data that getspassed in:class SimpleAuthorizationManager : ClaimsAuthorizationManager{public override bool CheckAccessAuthorizationContext context{ConsoleWriteLine"SimpleAuthorizationManager:";ConsoleWriteLine"Subject: {0}", contextSubjectIdentityName;ConsoleWriteLine"Actions:";foreach var action in contextAction{ConsoleWriteLine" {0}", actionClaimType;ConsoleWriteLine" {0}", actionValue;}ConsoleWriteLine"Resources:";foreach var resource in contextResource{ConsoleWriteLine" {0}", resourceClaimType;ConsoleWriteLine" {0}", resourceValue;}return true;}}While you could manually new up that class and directly callCheckAccess method – you can also use configuration to create theauthorization manager This has some interesting featuresFirst you need to configure the authorization manager in config:And then use the following code to create and use the authorizationmanager:var config = new ServiceConfiguration;var authz = configClaimsAuthorizationManager;var simpleContext = new AuthorizationContextprincipal, "Directory", "Browse";var allowed = authzCheckAccesssimpleContext;You can also use the ClaimsPrincipalPermission/Attribute classes whichsimplify the call and automate the creation from configuration:new ClaimsPrincipalPermission"Directory", "Browse"Demand;orClaimsPrincipalPermissionSecurityActionDemand,Resource = "Directory", Operation = "Browse"private static void BrowseDirectory{ }As with the normal PrincipalPermission – these classes throw aSecurityException and assume that you have populatedThreadCurrentPrincipalThe configuration for the claims authorization manager has aninteresting extensibility point You can attach arbitrary XML to theconfiguration element This allows to create policy statementsdirectly in config or provide enough information for the authorizationmanager to load the policy from somewhere else Whenever such anattached XML fragment exists, the configuration loader calls a specialconstructor of ClaimsAuthorizationManager and passes over the fragmentas an XmlNodeListpublic class PolicyAuthorizationManager : ClaimsAuthorizationManager{// this ctor gets called when there is a child element in appconfigpublic PolicyAuthorizationManager object objXmlElement {XmlNodeList nodes = objXmlElement as XmlNodeList;Processnodes;}}The same mechanism is also used for SecurityTokenHandlers btwThe Geneva SDK includes a sample that shows how to use thisextensibility point to parse authorization policy in theExtensibility folder With this sample you could write something likethis for the above authorization statements:Everything you’ve seen here can be used in arbitrary applicationtypes In the next post I show how this is integrated with WCF andASPNETIMAGE</description><link>http://www.secuobs.com/revue/news/118916.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/118916.shtml</guid></item>
<item><title>A closer look at Sandboxing in ASPNET V4</title><description>Secuobs.com : 2009-07-03 12:30:48 - www.leastprivilege.com -    In the last two posts I described how ASPNET uses the homogenousAppDomain model to implement partially trusted appsIn ASPNET you use the combination of a trust level aka grant setand a list of full trust assemblies to setup the homogenous AppDomainThis maps directly to the AppDomainCreate call that allows thecorresponding parameters to be passed inAnother option is to determine the trust level of applicationassemblies using a policy resolver The resolver gets called when anassembly gets loaded into the AppDomain and you can dynamicallyspecify if the assembly should run in full trust or the AppDomaingrant setThe second option is implemented using the new features aroundAppDomain managers in NET 40 read more here, here, here These newfeatures basically boil down to two new ways to specify anAppDomainManager for the default or newly created AppDomains You cannow either use configuration in the runtime section or specify theAppDomainManager type on the AppDomainSetup object when manuallycreating AppDomainsThis is exactly what ASPNET is doing The AppDomainManagerimplemented inSystemWebHostingApplicationManager+AspNetAppDomainManager is usedfor ASPNET created AppDomains This manager in turn uses a customHostSecurityManager implemented inSystemWebHostingApplicationManager+AspNetHostSecurityManager Thishost security manager in in turn expresses his interest to resolvepolicy when assemblies get loaded using the Flags propertyIn the ResolvePolicy method, the host security manager calls out tothe policy resolver if specified The return is then parsed andturned into either full trust/appdomain trust/nothing permission setsNiceThis mechanism is not special to ASPNET – and can be used inarbitrary applications Useful for writing hosts with more advancedrequirementsthanks to shawnfa/stefschIMAGE</description><link>http://www.secuobs.com/revue/news/116699.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/116699.shtml</guid></item>
<item><title>Identity Metasystem Interoperability Version 10</title><description>Secuobs.com : 2009-07-02 13:57:45 - www.leastprivilege.com -    The IMI spec is now approved GratsRead more here and get the spec hereIMAGE</description><link>http://www.secuobs.com/revue/news/116257.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/116257.shtml</guid></item>
<item><title>Partial Trust ASPNET in 40 Advanced Scenarios</title><description>Secuobs.com : 2009-07-01 09:57:20 - www.leastprivilege.com -    In the last post I showed you how to use the new CLR security model todo sandboxing in ASPNETOne new hook into this system is a custom host security policyresolver A policy resolver is a class that derives fromSystemWebHostingHostSecurityPolicyResolver The idea behind thisextensibility point is, that a resolver can decide at runtime asopposed to the static fullTrustAssemblies configuration element inwhich “permission bucket” the assembly should get loaded – AppDomaingrant set, full trust or nothingA resolver has a single method called ResolvePolicy ASPNET hands inthe evidence of every application assembly that gets loaded into theresolver, and it is the implementer’s job to decide the “trust level”ResolvePolicy returns a HostSecurityPolicyResults enum which can haveone of these values: DefaultPolicy, FullTrust, AppDomainTrust orNothingYou register the resolver using the following config element:A resolver must be in the GAC – otherwise you may receive a strangeexception saying “assembly still being loaded”…HTHIMAGE</description><link>http://www.secuobs.com/revue/news/115741.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/115741.shtml</guid></item>
<item><title>Partial Trust ASPNET in 40</title><description>Secuobs.com : 2009-06-30 17:46:26 - www.leastprivilege.com -    In NET v4 there are substantial changes to the CLR security modelRead about all the details here With Beta 1 in hand I gave the newmodel a try in the probably most popular host for partial trust –ASPNETYou start with setting the trust level in webconfig This worksexactly the same as in pre-V4 Also the same web_xytrustconfig filesfrom the framework configuration directory are used Since policylevels and code groups are not in effect any longer in V4, ASPNET bydefault uses the named permission set called ASPNet as the grant setfor the AppDomainYou can also specify a different set via the new permissionSetNameattributeSo far everything behaves like in CLR2 Now a typical thing to dowould be to factor out the “dangerous” code into separate assembliesand grant these assemblies full trust to do their work In CLR2 youeither GACed such an assembly or modified the security policy to grantwhatever permissions were neededSince there is no security policy anymore in V4 and ASPNET has movedto the homogenous AppDomain model – things work differently andeasier now In a homogenous AppDomain there are permission-wise twotypes of assemblies – ones constrained by the AppDomain grant set andfull trust assemblies With the new fullTrustAssemblies configurationelement, you can specify which assemblies should be loaded in fulltrust, eg:To make HelperLib callable from partial trust, you have to add thestandard AllowPartiallyTrustedCallers attribute to the assemblyWith the new transparency model in V4, APTCA means that the libraryprovides services to partially trusted code and can contain criticaland safe critical code All un-annotated code in an APTCA assemblybecomes security transparent by defaultThis is a huge improvement over the old model Since partially trustedcode is always transparent, it can only call transparent or safecritical code This means that in V4 you have to explicitly opt-inwhen you want to make a method callable from partial trust as opposedto all or nothing in V2 This is done by using theSecuritySafeCritical attributeThe typical pattern is that you provide safe critical “gateways” inyour library where you do all the security checks, input validationand asserts if necessary From there you then call into the criticalcode eg a library functionThe following is a simple example of a library that provides readaccess to certain directories to partially trusted ASPNETapplications:assembly: AllowPartiallyTrustedCallersnamespace HelperLib{public class Helper{SecuritySafeCriticalpublic string ReadFilestring filename{var perm = new FileIOPermissionFileIOPermissionAccessRead, GetAllowedContentDirs;permAssert;return FileReadAllTextfilename;}}}HTHIMAGE</description><link>http://www.secuobs.com/revue/news/115325.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/115325.shtml</guid></item>
<item><title>Updated Starter STS</title><description>Secuobs.com : 2009-06-17 13:25:58 - www.leastprivilege.com -    I just uploaded a minor update to the Starter STS sample to codeplexThis release adds more options for realm checking see theallowKnownRealmsOnly config switch as well as Information CardissuanceAs always – feedback is welcomehttp://starterstscodeplexcomIMAGE</description><link>http://www.secuobs.com/revue/news/110642.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/110642.shtml</guid></item>
<item><title>NET Access Control Service Talk from Troopers09</title><description>Secuobs.com : 2009-06-05 06:34:35 - www.leastprivilege.com -    I did a talk about the ACS in May It was interesting to present thattopic to a non-Developer, non-Microsoft minded audienceHere’s the outcome:http://wwwviddlercom/explore/TROOPERS/videos/1/_IMAGE</description><link>http://www.secuobs.com/revue/news/106113.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/106113.shtml</guid></item>
<item><title>Writing Custom Attribute Stores for Geneva Server B2</title><description>Secuobs.com : 2009-06-04 11:12:09 - www.leastprivilege.com -    This document appeard on the connect site Interesting_IMAGE</description><link>http://www.secuobs.com/revue/news/105709.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/105709.shtml</guid></item>
<item><title>Worker Process Accounts in IIS 75</title><description>Secuobs.com : 2009-06-03 23:06:37 - www.leastprivilege.com -    Windows 7 and Windows Server 2008 R2 ship with IIS 75 Whilemigrating the StarterSTS, I made an interesting observation Iremember vaguely I read about that somewhere – but basically I gotthis error message:Cannot open database "aspnetdb" requested by the login The loginfailedLogin failed for user 'IIS APPPOOLDefaultAppPool'That’s an interesting accountA closer look reveals, that in IIS manager you now have five accountsto choose from when setting up an App Pool: System, Network Service,Local Service, Custom… and ApplicationPoolIdentity The default valueis ApplicationPoolIdentityWith this new setting, a new primary SID is injected into the workerprocess – all Windows security checks are done against this new SIDConverting that NT Account to an SID reveals an S-1-5-82 – which wasnew to meSo in the light of the recent problems with system account sharing hereand here, this is a good change and makes it even easier to isolateworker processesHTH IMAGE</description><link>http://www.secuobs.com/revue/news/105576.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/105576.shtml</guid></item>
<item><title>Geneva Framework Quick Tip: Hosting a Security Token Service</title><description>Secuobs.com : 2009-05-28 13:32:52 - www.leastprivilege.com -    The idea of the security token service infrastructure in Geneva is,that it is completely host agnostic The STS itself expects aRequestSecurityToken and returns a RequestSecurityTokenResponse It isthe job of the host to translate some protocol back and forth to thistechnology independent representationThe key to STS hosting and that’s btw what the WCFWSTrustServiceContract class or the FederatedPassiveSignin web controldoes is to create a token service from configuration And thiscouldn’t be easier ;var config = new TokenServiceConfiguration;var sts = configCreateSecurityTokenService;var rstr = stsIssueprincipal, rst;HTHIMAGE</description><link>http://www.secuobs.com/revue/news/102662.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/102662.shtml</guid></item>
<item><title>Geneva Framework Quick Tip: How to access Configuration</title><description>Secuobs.com : 2009-05-28 13:32:52 - www.leastprivilege.com -    Remember that Geneva framework is a framework – all the niceintegration into WCF and ASPNET is built on top of a public API Thisalso means that you can use Geneva framework for integration inarbitrary hosts and environmentsOne thing you most often need is access to the Geneva frameworkconfiguration microsoftidentityModel section from code – and againthis is very easy:ServiceConfiguration config = newServiceConfigurationServiceConfigurationDefaultServiceName;HTHIMAGE</description><link>http://www.secuobs.com/revue/news/102661.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/102661.shtml</guid></item>
<item><title>Starter STS Screencasts</title><description>Secuobs.com : 2009-05-27 17:04:56 - www.leastprivilege.com -    All two screencasts about the starter STS sample are online now:*  Setup et Overview download*  Advanced Topics et Configuration downloadIMAGE</description><link>http://www.secuobs.com/revue/news/102251.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/102251.shtml</guid></item>
<item><title>Thinktecture Security Token Service Starter Kit</title><description>Secuobs.com : 2009-05-26 16:18:31 - www.leastprivilege.com -    I am happy to announce the “Thinktecture STS Starter Kit” sample TheSTS starter kit is a compact, easy to use identity provider that iscompletely based on the ASPNET provider infrastructure It is builtusing the Geneva framework Beta 2 bits and is a self contained website with passive and active endpoints Christian has some screenshotsIMAGEThe motivation behind writing this sample is twofold First, writing acustom STS from scratch is not terribly hard – but it is also not atrivial task In addition the full featured Geneva Server product maynot fit your requirements eg because your users are not stored inActive Directory So a lot of people I spoke to mentioned that itwould be nice to have a simple STS that uses membership, roles andprofile and that is easy to setup and get goingThe other reason is that starter STS is not terribly complex and couldbe used as a learning tool on how to write custom token services Youcould eg replace the provider plumbing with your own libraries whileyou goSome features:*  active and passive security token service*  supports WS-Federation, WS-Trust 13 message and mixed and SAML11/20 tokens*  based on the standard membership, roles and profile providerinfrastructure*  membership provider is used to authenticate users and to providea name and email claim*  role provider is used for authorization in the web front-end andto provider role claims*  profile provider is used to allow users to supply profileinformation which gets turned into claims*  easy administration of the provider features using the IIS7manager*  easy configuration – you don’t have to deal with Geneva or WCFsettings directly*  control over security policy SSL, encryption, SOAP security*  dynamic web UI to allow users to maintain their profile data*  automatic generation of a WS-Federation metadata document toallow RPs to federate using eg FedUtilTo make it even easier for you to setup and start using the STS, Ihave recorded a screencast that walks you through the installation andsetup process In the following posts I will focus more on on some ofthe feature areas and explain how they are used and implemented HavefunDownload STS Starter Kit SampleDownload SetupetOverview ScreencastIMAGE</description><link>http://www.secuobs.com/revue/news/101713.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/101713.shtml</guid></item>
<item><title>Use Geneva Session Management for your own needs</title><description>Secuobs.com : 2009-05-24 20:42:03 - www.leastprivilege.com -    Geneva Framework is a Framework is a FrameworkOne part of that framework is the SessionAuthenticationModule forASPNET In all the typical samples this is used to convert anincoming SAML token to a cookie to establish an authenticationsessionA closer look reveals, that the purpose of this module is actuallyserializing SessionSecurityTokens into cookies A SessionSecurityTokenin turn is a container for an IClaimsPrincipal and an additionalSecurityToken the so called bootstrap tokenThis means that the SessionAuthenticationModule is a general moduleand API to serialize claims principals and security tokens intocookies In addition there is an extensible architecture around howthese cookies are layed out and protected You can utilize thisinfrastructure whenever you need to serialize and round-trip anIClaimsPrincipalWhere can this be useful Let’s do this little walkthrough…First use the Visual Studio Geneva templates to create a simple“Claims-aware ASPNet WebSite” This sample uses theClaimsPrincipalHttpModule to create an IClaimsPrincipal from thestandard forms authentication principalIn the next step add a ClaimsAuthenticationManager to the web site andregister it, eg:public class Transformer : ClaimsAuthenticationManager{public override IClaimsPrincipal Authenticatestring endpointUri,IClaimsPrincipal incomingPrincipal{// expensive operationincomingPrincipalIdentities0ClaimsAddnewClaim"http://claims/expensive", "expensive value";return incomingPrincipal;}}The custom claims you are adding in the authentication manager mightcome from some remote data store and you probably want to avoid such around-trip on every request To optimize this, you could come up withsome server-local caching strategy – or use theSessionAuthenticationModule to serialize the IClaimsPrincipal aftertransformation to a cookie The module will then reconstruct theIClaimsPrincipal on subsequest requests and set it as the currentprincipal for the ASPNET applicationFirst add the session authentication module to the modules section inwebconfig – then add this code to the authentication manager:private void SetSessionCookieIClaimsPrincipal incomingPrincipal{SessionSecurityToken token = new SessionSecurityTokenincomingPrincipal;FederatedAuthenticationSessionAuthenticationModuleWriteSessionTokenToCookietoken;}Call this method before you return the transformed principal back toGenevaNote: When your app is not running over SSL – you need to set therequireSsl setting for the cookie handler in webconfig to falseIMAGE</description><link>http://www.secuobs.com/revue/news/101213.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/101213.shtml</guid></item>
<item><title>Thinktecture WS-Federation Metadata Generator</title><description>Secuobs.com : 2009-05-22 19:19:15 - www.leastprivilege.com -    Mr Metadata strikes back This time with a generator/wizard forWS-Federation Metadata language This makes it very easy to createdocuments that can be consumed by Geneva Server or FedUtilMore info hereIMAGE</description><link>http://www.secuobs.com/revue/news/100625.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/100625.shtml</guid></item>
<item><title>NET 40 Security</title><description>Secuobs.com : 2009-05-21 08:00:59 - www.leastprivilege.com -    Now that Beta 1 has shipped I am finally allowed to talk about thenew/changed security features in 40 – but there is no one who canexplain these things more elaborate and insightful than Shawn I justsaw that he is about to start a series of posts on the new featureareas So watch his space closelyah – and btw – leave a comment on his blog that he should write abook about security in NET 40 – maybe we can convince him ;IMAGE</description><link>http://www.secuobs.com/revue/news/99879.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/99879.shtml</guid></item>
<item><title>More Geneva Beta 2 Changes</title><description>Secuobs.com : 2009-05-18 20:14:29 - www.leastprivilege.com -    Just came across this document Interesting readIMAGE</description><link>http://www.secuobs.com/revue/news/97897.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/97897.shtml</guid></item>
<item><title>Geneva Beta 2 Update: ClaimsPrincipalHttpModule</title><description>Secuobs.com : 2009-05-18 11:06:36 - www.leastprivilege.com -    I am currently in the process of updating my Geneva code to Beta 2There are some pretty substantial changes/additions in the new Beta –so I thought I’ll detail some of them while moving along Today:ClaimsPrincipalHttpModuleFor a basic understanding what the module does, I recommend reading myinitial post hereStarting with Beta 2, ClaimsPrincipalHttpModule supports convertingX509 client certificates to an IClaimsPrincipal This is done by usingthe ctor of IClaimsIdentity that takes an X509Certificate2 whichresults in an authenticated identity with an authentication type setto “SSL/PCT”Now as always, certificate based authentication is a little differentto eg username/password In the strict sense a user is authenticatedwhen you know “who he is” For usernames/passwords authentication thismeans as soon as you have successfully validated the password againstyour data store or put differently – as soon as the user provides aproof for his identity Proofing identity in the certificate casebasically means that the certificate is trusted and the client “knows”the corresponding private key That’s why theClaimsPrincipalHttpModule sets IsAuthenticated=true when the clientcertificate is validNow Windows/IIS supports a number of certificate issuers and a usercan potentially present a client cert to IIS which is “valid” but theclient may still not be a valid/registered user in your system Thisresults depending on your design in different semantics for“IsAuthenticated” checks like RequestIsAuthenticated or A better way would be to replace blanket authentication checks withchecks for specific claims like a “User” role or some permissionHTHIMAGE</description><link>http://www.secuobs.com/revue/news/97595.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/97595.shtml</guid></item>
<item><title>Establishing Trust with the NET Access Control Service Geneva Beta 2</title><description>Secuobs.com : 2009-05-15 10:41:30 - www.leastprivilege.com -    In Geneva you use a IssuerNameRegistry to establish trust with tokenissuers The job of the registry is to parse the issuer details andreturn a well-known string identifying that issuer If the registrycannot determine that well known string, the issuer is considerednon-trusted and request processing is stoppedTypically it is enough to inspect the X509 certificate that was usedto issue the SAML token, but with the Access Control Service thesituation is a little different The ACS uses a multi-tenant model andsigns all outgoing tokens with the same certificate This means it isnot sufficient to check the signature only to determine that the tokenwas issued by a specific instance of the ACSIn addition you also have to check the value of the SAML issuer URIwhich contains the logical issuer name which in turn contains the ACSsolution name Prior to Geneva Beta 2 you had to use two differentextensibility points to do both checks I wrote about that hereStarting with Beta 2, the issuer name registry now has the capabilityto parse both the physical and logical issuer GreatFind a sample implementation below:class AccessControlServiceIssuerNameRegistry : IssuerNameRegistry{string _solutionName = "leastprivilege";string _acsThumbprint = "6de1689a739d548a5690dbc3894b953ef6123d93";string _samlIssuer;public AccessControlServiceIssuerNameRegistry{_samlIssuer = StringFormat"http://{0}accesscontrolwindowsnet/",_solutionName;}public override string GetIssuerNameSecurityToken securityToken{// should never get calledthrow new NotImplementedException;}public override string GetIssuerNameSecurityToken securityToken,string requestedIssuerName{var issuerToken = securityToken as X509SecurityToken;if issuerToken == null{throw new ArgumentException"securityToken";}if stringIsNullOrEmptyrequestedIssuerName{throw new ArgumentNullException"requestedIssuerName";}if stringEquals_acsThumbprint, issuerTokenCertificateThumbprint,StringComparisonOrdinalIgnoreCase{throw new SecurityTokenException"Token not issued by the Access Control Service";}if stringEquals_samlIssuer, requestedIssuerName, StringComparisonOrdinalIgnoreCase{throw new SecurityTokenException"Token not issued by the requested instance of the Access ControlService";}return _samlIssuer;}}IMAGE</description><link>http://www.secuobs.com/revue/news/96694.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/96694.shtml</guid></item>
<item><title>Die Information Card Foundation DACH-Initiative</title><description>Secuobs.com : 2009-05-11 18:56:20 - www.leastprivilege.com -    Mehr Infos hier…IMAGEIMAGE</description><link>http://www.secuobs.com/revue/news/94508.shtml</link><guid isPermaLink="false">http://www.secuobs.com/revue/news/94508.shtml</guid></item>
</channel>
</rss>
 
