Skip to content

Commit

Permalink
Describe how to set the Owin middleware options in code
Browse files Browse the repository at this point in the history
Fixes #654
  • Loading branch information
explunit committed Mar 4, 2017
1 parent bc4a8fd commit bc843c6
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions doc/OwinMiddleware.md
Expand Up @@ -6,18 +6,29 @@ authentication pipeline and is compatible with ASP.NET Identity. Kentor
AuthServices provides external login in the same way as the built in
Google, Facebook and Twitter providers.

To use the Kentor AuthServices middleware, it need to be configured in
To use the Kentor AuthServices middleware, it needs to be configured in
`Startup.Auth.Cs`.

app.UseKentorAuthServicesAuthentication(new KentorAuthServicesAuthenticationOptions());

The options class only contains the owin specific configuration (such as the
The options class only contains the Owin-specific configuration (such as the
name used to identify the login provider). The rest of the configuration is
read from the web.config/app.config and [configured in the same way](Configuration.md)
as when using the http module or the MVC controller.

If you would like to provide the AuthServices-related configuration in code, specify `false` for
the `loadConfiguration` constructor parameter and then build the options based on your own
logic. For example:

var myAuthServicesOptions = new KentorAuthServicesAuthenticationOptions(false)
// more logic to set SPOptions, etc.
app.UseKentorAuthServicesAuthentication(myAuthServicesOptions);

You can see a full example of this in the **SampleOwinApplication** project included in the
source code. See the [Startup.Auth.cs file](https://github.com/KentorIT/authservices/blob/master/SampleOwinApplication/App_Start/Startup.Auth.cs)

##Selecting Idp
An Owin based application issues a AuthenticationResponseChallenge to ask the
An Owin-based application issues an AuthenticationResponseChallenge to ask the
middleware to begin the authentication procedure. In that challenge, there is
a properties dictionary. To use a specified idp, the entity id of the idp should
be entered in that dictionary under the key "idp".
Expand Down

0 comments on commit bc843c6

Please sign in to comment.