Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

ArgumentException: The 'ClientId' option must be provided

$
0
0

Attempting to do 3rd party authentication using Facebook.  This used to work under .Net Core 1.0, but I just upgraded to VS2017 and .Net Core 1.1.

Complete error is:

ArgumentException: The 'ClientId' option must be provided.

Microsoft.AspNetCore.Authentication.OAuth.OAuthMiddleware..ctor(RequestDelegate next, IDataProtectionProvider dataProtectionProvider, ILoggerFactory loggerFactory, UrlEncoder encoder, IOptions<SharedAuthenticationOptions> sharedOptions, IOptions<TOptions> options)

ArgumentException: The 'ClientId' option must be provided.

Microsoft.AspNetCore.Authentication.OAuth.OAuthMiddleware..ctor(RequestDelegate next, IDataProtectionProvider dataProtectionProvider, ILoggerFactory loggerFactory, UrlEncoder encoder, IOptions<SharedAuthenticationOptions> sharedOptions, IOptions<TOptions> options)

Microsoft.AspNetCore.Authentication.Facebook.FacebookMiddleware..ctor(RequestDelegate next, IDataProtectionProvider dataProtectionProvider, ILoggerFactory loggerFactory, UrlEncoder encoder, IOptions<SharedAuthenticationOptions> sharedOptions, IOptions<FacebookOptions> options)

Microsoft.Extensions.Internal.ActivatorUtilities+ConstructorMatcher.CreateInstance(IServiceProvider provider)

Microsoft.Extensions.Internal.ActivatorUtilities.CreateInstance(IServiceProvider provider, Type instanceType, Object[] parameters)

Microsoft.AspNetCore.Builder.UseMiddlewareExtensions+<>c__DisplayClass3_0.<UseMiddleware>b__0(RequestDelegate next)

Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder.Build()

Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

I noted that .AddUserSecrets() deprecated so I updated to .AddUserSecrets<Startup>();

.csproj is as follows:

<Project Sdk="Microsoft.NET.Sdk.Web"><PropertyGroup><TargetFramework>netcoreapp1.1</TargetFramework><PreserveCompilationContext>true</PreserveCompilationContext><AssemblyName>SP_Reports</AssemblyName><OutputType>Exe</OutputType><PackageId>SP_Reports</PackageId><UserSecretsId>aspnet-SP_Reports-fe51af8e-b15e-40b8-a748-9260b3185259</UserSecretsId><PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback><RuntimeFrameworkVersion>1.1.1</RuntimeFrameworkVersion></PropertyGroup><ItemGroup><None Update="wwwroot\**\*;Views\**\*;Areas\**\Views"><CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory></None></ItemGroup><ItemGroup><ProjectReference Include="..\SP_Common_Classes\SP_Common_Classes.csproj" /></ItemGroup><ItemGroup><PackageReference Include="Microsoft.AspNetCore.Authentication.Facebook" Version="1.1.1" /><PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="1.1.1" /><PackageReference Include="Microsoft.AspNetCore.Mvc" Version="1.1.2" /><PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="1.1.1" /><PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="1.1.1" /><PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" /><PackageReference Include="Microsoft.EntityFrameworkCore" Version="1.1.1" /><PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="1.1.1" /><PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="1.1.1" /><PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="1.1.0" /><PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="1.1.1" /><PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="1.1.1" /><PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="1.1.1" /><PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="1.1.1" /><PackageReference Include="Microsoft.Extensions.Logging" Version="1.1.1" /><PackageReference Include="Microsoft.Extensions.Logging.Console" Version="1.1.1" /><PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="1.1.1" /><PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.1" /><PackageReference Include="Microsoft.VisualStudio.Web.BrowserLink" Version="1.1.0" /></ItemGroup><Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"><Exec Command="bower install" /><Exec Command="dotnet bundle" /></Target><ItemGroup><DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.2.301" /><DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="1.0.0" /></ItemGroup></Project>

Any suggestions??


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>