1
1
// Copyright (c) .NET Foundation. All rights reserved.
2
2
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3
3
4
- // OpenID is obsolete
5
- #pragma warning disable 618
6
-
7
4
using System ;
8
- using Microsoft . Owin . Security ;
9
5
using Microsoft . Owin . Security . Google ;
10
6
11
7
namespace Owin
12
8
{
13
9
/// <summary>
14
- /// Extension methods for using <see cref="GoogleAuthenticationMiddleware "/>
10
+ /// Extension methods for using <see cref="GoogleOAuth2AuthenticationMiddleware "/>
15
11
/// </summary>
16
12
public static class GoogleAuthenticationExtensions
17
13
{
18
- /// <summary>
19
- /// Authenticate users using Google OpenId
20
- /// </summary>
21
- /// <param name="app">The <see cref="IAppBuilder"/> passed to the configuration method</param>
22
- /// <param name="options">Middleware configuration options</param>
23
- /// <returns>The updated <see cref="IAppBuilder"/></returns>
24
- [ Obsolete ( "Google is discontinuing support for the OpenId. Use OAuth2 instead." , error : false ) ]
25
- public static IAppBuilder UseGoogleAuthentication ( this IAppBuilder app , GoogleAuthenticationOptions options )
26
- {
27
- if ( app == null )
28
- {
29
- throw new ArgumentNullException ( "app" ) ;
30
- }
31
- if ( options == null )
32
- {
33
- throw new ArgumentNullException ( "options" ) ;
34
- }
35
-
36
- app . Use ( typeof ( GoogleAuthenticationMiddleware ) , app , options ) ;
37
- return app ;
38
- }
39
-
40
- /// <summary>
41
- /// Authenticate users using Google OpenId
42
- /// </summary>
43
- /// <param name="app">The <see cref="IAppBuilder"/> passed to the configuration method</param>
44
- /// <returns>The updated <see cref="IAppBuilder"/></returns>
45
- [ Obsolete ( "Google is discontinuing support for the OpenId. Use OAuth2 instead." , error : false ) ]
46
- public static IAppBuilder UseGoogleAuthentication (
47
- this IAppBuilder app )
48
- {
49
- return UseGoogleAuthentication (
50
- app ,
51
- new GoogleAuthenticationOptions ( ) ) ;
52
- }
53
-
54
14
/// <summary>
55
15
/// Authenticate users using Google OAuth 2.0
56
16
/// </summary>
@@ -97,5 +57,4 @@ public static IAppBuilder UseGoogleAuthentication(
97
57
} ) ;
98
58
}
99
59
}
100
- }
101
- #pragma warning restore 618
60
+ }
0 commit comments