Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Add a code example #248

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docsv2/advanced/csp.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,17 @@ IdentityServer3 allows the hosting application to configure a `CspOptions` on th
* `FrameSrc` (added in v2.4) : allows for additional `frame-src` values to be added to the default policy.

CSP allows for a reporting endpoint to be configured. IdentityServer provides a CSP report endpoint which is described [here](../endpoints/csp.html).

### Example

This will allow loading scripts, styles, and fonts from MaxCDN and Google's CDN.

```
CspOptions = new CspOptions
{
Enabled = true,
ScriptSrc = "https://ajax.googleapis.com https://maxcdn.bootstrapcdn.com",
StyleSrc = "https://maxcdn.bootstrapcdn.com https://fonts.googleapis.com",
FontSrc = "https://maxcdn.bootstrapcdn.com https://fonts.googleapis.com https://fonts.gstatic.com"
}
```