Skip to content

Commit e4fee8e

Browse files
Merge pull request #1 from andresmoschini/dplr-10952-upgrade-to-beta8
DPLR-10952 - Upgrade to beta8
2 parents e920682 + 80bd856 commit e4fee8e

File tree

7 files changed

+37
-40
lines changed

7 files changed

+37
-40
lines changed

NuGet.Config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
55
<clear />
66
<add key="api.nuget.org" value="https://api.nuget.org/v3/index.json" />
7-
<add key="aspnetrelease" value="https://www.myget.org/F/aspnetrelease/api/v2" />
7+
<add key="aspnetrelease" value="https://www.myget.org/F/aspnetrelease/api/v3/index.json" />
88
<add key="makingsense-aspnet" value="https://ci.appveyor.com/nuget/makingsense-aspnet" />
99
</packageSources>
1010
<packageSourceCredentials>

appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
nuget:
22
account_feed: true
33

4-
version: 0.1.0-beta7-{build}
4+
version: 0.1.0-beta8-{build}
55

66
# init:
77
# - git config --global core.autocrlf true
@@ -11,15 +11,15 @@ version: 0.1.0-beta7-{build}
1111
# - cmd: nuget sources add -Name aspnetrelease -Source https://www.myget.org/F/aspnetrelease/api/v2
1212

1313
#environment:
14-
# DNX_BUILD_VERSION: beta7
14+
# DNX_BUILD_VERSION: beta8
1515
# DNX_ASSEMBLY_FILE_VERSION: 2.0.0
1616

1717
before_build:
18-
- ps: dnvm install 1.0.0-beta7
18+
- ps: dnvm install 1.0.0-beta8
1919
- ps: dnvm upgrade
2020
- ps: dnvm update-self
2121
- ps: dnvm list
22-
- ps: dnvm use 1.0.0-beta7
22+
- ps: dnvm use 1.0.0-beta8
2323
- ps: dnu restore
2424
- cmd: set DNX_BUILD_VERSION=%APPVEYOR_BUILD_NUMBER%
2525

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"projects": [ "src", "test" ],
33
"sdk": {
4-
"version": "1.0.0-beta7"
4+
"version": "1.0.0-beta8"
55
}
66
}

src/MakingSense.AspNet.Authentication.SimpleToken/SimpleTokenAppBuilderExtensions.cs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@ public static class SimpleTokenAppBuilderExtensions
1111
{
1212
public static IApplicationBuilder UseSimpleTokenAuthentication([NotNull] this IApplicationBuilder app, Action<SimpleTokenAuthenticationOptions> configureOptions = null, string optionsName = "")
1313
{
14-
return app.UseMiddleware<SimpleTokenAuthenticationMiddleware>(
15-
new ConfigureOptions<SimpleTokenAuthenticationOptions>(o =>
16-
{
17-
if (configureOptions != null)
18-
{
19-
configureOptions(o);
20-
}
21-
if (o.SecurityTokenValidatorsFactory == null)
22-
{
23-
o.SecurityTokenValidatorsFactory = () => app.ApplicationServices.GetServices<ISecurityTokenValidator>();
24-
}
25-
})
26-
{
27-
Name = optionsName
28-
});
14+
var options = new SimpleTokenAuthenticationOptions()
15+
{
16+
AuthenticationScheme = optionsName
17+
};
18+
19+
if (configureOptions != null)
20+
{
21+
configureOptions(options);
22+
}
23+
24+
if (options.SecurityTokenValidatorsFactory == null)
25+
{
26+
options.SecurityTokenValidatorsFactory = () => app.ApplicationServices.GetServices<ISecurityTokenValidator>();
27+
}
28+
29+
return app.UseMiddleware<SimpleTokenAuthenticationMiddleware>(options);
2930
}
3031
}
3132
}

src/MakingSense.AspNet.Authentication.SimpleToken/SimpleTokenAuthenticationHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Threading.Tasks;
77
using MakingSense.AspNet.Authentication.Abstractions;
88
using Microsoft.AspNet.Authentication;
9+
using Microsoft.Net.Http.Headers;
910

1011
namespace MakingSense.AspNet.Authentication.SimpleToken
1112
{
@@ -23,7 +24,7 @@ public class SimpleTokenAuthenticationHandler : AuthenticationHandler<SimpleToke
2324
/// </returns>
2425
public static string ExtractToken(HttpRequest request)
2526
{
26-
var authorizationHeader = request.Headers.Get("Authorization");
27+
var authorizationHeader = (string)request.Headers[HeaderNames.Authorization];
2728
if (authorizationHeader != null)
2829
{
2930
// Search in Authorization Request Header Field (http://tools.ietf.org/html/rfc6750#section-2.1)
@@ -53,7 +54,7 @@ public static string ExtractToken(HttpRequest request)
5354
}
5455

5556
// Search in URI Query Parameter (http://tools.ietf.org/html/rfc6750#section-2.3)
56-
var tokenFromQuery = request.Query["access_token"] ?? request.Query["api_key"];
57+
var tokenFromQuery = (string)request.Query["access_token"] ?? request.Query["api_key"];
5758
if (tokenFromQuery != null)
5859
{
5960
return tokenFromQuery.Trim();

src/MakingSense.AspNet.Authentication.SimpleToken/SimpleTokenAuthenticationMiddleware.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,10 @@ public class SimpleTokenAuthenticationMiddleware : AuthenticationMiddleware<Simp
2222
/// </summary>
2323
public SimpleTokenAuthenticationMiddleware(
2424
[NotNull] RequestDelegate next,
25+
[NotNull] SimpleTokenAuthenticationOptions options,
2526
[NotNull] ILoggerFactory loggerFactory,
26-
[NotNull] IOptions<SimpleTokenAuthenticationOptions> options,
27-
[NotNull] IUrlEncoder encoder,
28-
ConfigureOptions<SimpleTokenAuthenticationOptions> configureOptions)
29-
: base(next, options, loggerFactory, encoder, configureOptions)
27+
[NotNull] IUrlEncoder encoder)
28+
: base(next, options, loggerFactory, encoder)
3029
{
3130
}
3231

src/MakingSense.AspNet.Authentication.SimpleToken/project.json

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "0.1.0-beta7-*",
2+
"version": "0.1.0-beta8-*",
33
"description": "MakingSense.AspNet.Authentication.SimpleToken Class Library",
44
"authors": [ "MakingSense" ],
55
"tags": [ "ASP.NET 5", "vnext", "authentication", "token", "bearer" ],
@@ -10,25 +10,21 @@
1010
"projectUrl": "https://github.com/MakingSense/aspnet-authentication-simpletoken",
1111
"licenseUrl": "http://www.gnu.org/licenses/lgpl.html",
1212
"dependencies": {
13-
"MakingSense.AspNet.Abstractions": "0.1.0-beta7",
14-
"Microsoft.AspNet.Authentication": "1.0.0-beta7",
15-
"Microsoft.Framework.NotNullAttribute.Sources": {
16-
"type": "build",
17-
"version": "1.0.0-beta7"
18-
},
13+
"MakingSense.AspNet.Abstractions": "0.1.0-beta8",
14+
"Microsoft.AspNet.Authentication": "1.0.0-beta8",
1915
"Newtonsoft.Json": "6.0.8",
20-
"System.IdentityModel.Tokens": "5.0.0-beta7-208241120"
16+
"System.IdentityModel.Tokens": "5.0.0-beta8-210131116"
2117
},
2218

2319
"frameworks": {
2420
"dnx451": { },
2521
"dnxcore50": {
2622
"dependencies": {
27-
"Microsoft.CSharp": "4.0.1-beta-23225",
28-
"System.Collections": "4.0.11-beta-23225",
29-
"System.Linq": "4.0.1-beta-23225",
30-
"System.Runtime": "4.0.21-beta-23225",
31-
"System.Threading": "4.0.11-beta-23225"
23+
"Microsoft.CSharp": "4.0.1-beta-23409",
24+
"System.Collections": "4.0.11-beta-23409",
25+
"System.Linq": "4.0.1-beta-23409",
26+
"System.Runtime": "4.0.21-beta-23409",
27+
"System.Threading": "4.0.11-beta-23409"
3228
}
3329
}
3430
}

0 commit comments

Comments
 (0)