Skip to content

Commit

Permalink
Merge pull request #16 from rudism/doc-and-no-cache-fix
Browse files Browse the repository at this point in the history
disabling client caching on authentication endpoint, updated docs
  • Loading branch information
petrsvihlik authored Aug 6, 2020
2 parents 5032a82 + 52d9b03 commit 41f48ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ public void ConfigureServices(IServiceCollection services)
{
services
.AddMvc() // Or AddControllers, or similar...
.AddApplicationPart(typeof(VanillaApiClient).GetTypeInfo().Assembly) // Add the controllers from this
.AddJsonOptions(o =>
{
o.JsonSerializerOptions.PropertyNamingPolicy = null;
o.JsonSerializerOptions.IgnoreNullValues = true;
});
.AddApplicationPart(typeof(VanillaApiClient).GetTypeInfo().Assembly); // Add the controllers from this
services.AddSingleton(Configuration);
services.AddTransient<HashAlgorithm>(h => SHA512.Create()); // Reflect the hashing algorithm set in Vanilla Forums
Expand All @@ -35,7 +30,8 @@ public void ConfigureServices(IServiceCollection services)
"ClientId": "your_client_id",
"ClientSecret": "your_secret",
"TimestampValidFor": "int_seconds",
"AllowWhitespaceInUsername": "bool"
"AllowWhitespaceInUsername": "bool",
"BaseUri": "http://your-vanilla-forum.com/"
}
```
**4.** Make sure the `HttpContext.User` has the following claims set according to the [documentation](http://docs.vanillaforums.com/help/sso/jsconnect/seamless/):
Expand Down
1 change: 1 addition & 0 deletions src/jsConnect/Controllers/JsConnectController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ public JsConnectController(IConfiguration configuration, ILogger<JsConnectContro
/// </summary>
[HttpGet("[action]")]
[Produces("application/json")]
[ResponseCache(NoStore = true, Duration = 0)]
public async Task<ActionResult> AuthenticateAsync([FromQuery] string client_id, [FromQuery] string callback, [FromQuery] int? timestamp = null, [FromQuery] string signature = null)
{
JsConnectResponseModel jsConnectResult = new JsConnectResponseModel();
Expand Down

0 comments on commit 41f48ec

Please sign in to comment.