Authservices StubIdp Improvements: AttributeStatements and User Lists

This is an announcement of two new related features in the Authservices SAML2 StubIdp, AttributeStatements and user lists.


Until now the only identification related element supported by the StubIdp was the Subject NameID.
In many SAML2 installations additional data, like roles and full name, are included as AttributeStatements. This has been supported by the AuthServices library, but it has not been possible to generate testdata with the StubIdp.
Now we have implemented a dynamic list of AttributeStatements in the StubIdp.

You can enter statements like this


resulting in the following Assertion in the Saml2Response

<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion"
		<saml2:SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer" />
	<saml2:Conditions NotOnOrAfter="2015-06-29T07:56:39Z" />
		<saml2:Attribute Name="">
		<saml2:Attribute Name="SpecialPowers">
			<saml2:AttributeValue>All of them</saml2:AttributeValue>

(Captured with the Firefox plugin SAML Tracer)
The AttributeStatements will appear as claims on System.Security.Claims.ClaimsPrincipal.Current.Claims in your c# code.

Let the content of the above response serve as a reminder to make sure you only trust the production IDP:s in your production environment.

User Lists

Until now the StubIdp has been useful for testing SAML2 implementations, but has not been designed to serve as a log in solution for test environments. Now we have implemented the ability to register a unique IDP within the StubIdp and supply a list of users complete with NameID and AttributeStatements.

To register a new IDP go to and click on the “create your own IDP” link. This creates a unique IDP identified by a GUID and redirects you to the manage page of the IDP. On the manage page you can define a custom description displayed a the top of your IDP page. Here you can supply a description to introduce your users to your system. You can also supply a default AssertionServiceConsumer URL to be used for unsolicited AuthnResponses from the StubIdp.

Finally you can supply a user list. This list will be displayed as a drop down on your IDP page, making it easy to select a user from the list to get the predefined NameID and AttributeStatements filled in. On each user you can enter a description field that is shown beside the dropdown if you want to describe the characteristics of each test user in regular text.

A sample configuration

  "DefaultAssertionConsumerServiceUrl": " (optional, you may remove this line)",
  "IdpDescription": "This is my custom IDP description",
  "UserList": [
      "DisplayName": "John Doe",
      "Description": "Just a regular user",
      "Assertion": {
        "NameId": "JohnDoe"
      "DisplayName": "Admin Almighty",
      "Description": "Admin with super powers",
      "Assertion": {
        "NameId": "AdminAlmighty",
        "AttributeStatements": [
            "Type": "",
            "Value": "Administrator"
            "Type": "",
            "Value": "root"
            "Type": "SpecialPowers",
            "Value": "All of them"

Resulting in the following appearance in the StubIdp
Selecting this fills in NameId and AttributeStatements as in the example above.

  • Leave a Reply

    Your name as it will be displayed on the posted comment.
    Your e-mail address will not be published. It is only used if I want to get in touch during comment moderation.
    Your name will be a link to this address.
Software Development is a Job – Coding is a Passion

I'm Anders Abel, an independent systems architect and developer in Stockholm, Sweden.

profile for Anders Abel at Stack Overflow, Q&A for professional and enthusiast programmers

Code for most posts is available on my GitHub account.

Popular Posts



Powered by WordPress with the Passion for Coding theme.