Setting up UmbracoCms.IdentityExtensions - but receiving errors
Hi,
I am trying to set up a custom Umbraco Back Office Login for Umbraco 7.8.1. I have read a lot of articles on line about UmbracoCms.IdentityExtensions, that can be extended to use Google/Facebook login etc.
I have performed the following steps.
I have setup a clean / empty web project on Visual Studio Community 2017
Installed Umbraco CMS
PM> install-package UmbracoCMS
Ran the project and installed Umbraco. (it works ok)
PM>Install-Package UmbracoCms.IdentityExtensions
This added an number of files to the App_Start folder. eg
UmbracoStandardOwinStartup.cs and amended the web.config.
this is the code for 'UmbracoStandardOwinStartup.cs'
using Microsoft.Owin;
using Owin;
using Umbraco.Core;
using Umbraco.Core.Security;
using Umbraco.Web;
using Umbraco.Web.Security.Identity;
using Umbraco.IdentityExtensions;
using DemoProject;
//To use this startup class, change the appSetting value in the web.config called
// "owin:appStartup" to be "UmbracoStandardOwinStartup"
[assembly: OwinStartup("UmbracoStandardOwinStartup", typeof(UmbracoStandardOwinStartup))]
namespace DemoProject
{
/// <summary>
/// The standard way to configure OWIN for Umbraco
/// </summary>
/// <remarks>
/// The startup type is specified in appSettings under owin:appStartup - change it to "StandardUmbracoStartup" to use this class
/// </remarks>
public class UmbracoStandardOwinStartup : UmbracoDefaultOwinStartup
{
public override void Configuration(IAppBuilder app)
{
//ensure the default options are configured
base.Configuration(app);
/*
* Configure external logins for the back office:
*
* Depending on the authentication sources you would like to enable, you will need to install
* certain Nuget packages.
*
* For Google auth: Install-Package UmbracoCms.IdentityExtensions.Google
* For Facebook auth: Install-Package UmbracoCms.IdentityExtensions.Facebook
* For Microsoft auth: Install-Package UmbracoCms.IdentityExtensions.Microsoft
* For Azure ActiveDirectory auth: Install-Package UmbracoCms.IdentityExtensions.AzureActiveDirectory
*
* There are many more providers such as Twitter, Yahoo, ActiveDirectory, etc... most information can
* be found here: http://www.asp.net/web-api/overview/security/external-authentication-services
*
* For sample code on using external providers with the Umbraco back office, install one of the
* packages listed above to review it's code samples
*
*/
/*
* To configure a simple auth token server for the back office:
*
* By default the CORS policy is to allow all requests
*
* app.UseUmbracoBackOfficeTokenAuth(new BackOfficeAuthServerProviderOptions());
*
* If you want to have a custom CORS policy for the token server you can provide
* a custom CORS policy, example:
*
* app.UseUmbracoBackOfficeTokenAuth(
* new BackOfficeAuthServerProviderOptions()
* {
* //Modify the CorsPolicy as required
* CorsPolicy = new CorsPolicy()
* {
* AllowAnyHeader = true,
* AllowAnyMethod = true,
* Origins = { "http://mywebsite.com" }
* }
* });
*/
}
}
}
Within the web.config I have added the line in side the appSettings.
When I now run the project I get the following error.
The following errors occurred while attempting to load the app.
- The OwinStartupAttribute.FriendlyName value 'UmbracoDefaultOwinStartup' does not match the given value 'UmbracoStandardOwinStartup' in Assembly 'umbraco, Version=1.0.6614.16987, Culture=neutral, PublicKeyToken=null'.
- The given type or method 'UmbracoStandardOwinStartup' was not found. Try specifying the Assembly.
To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config.
To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.
I have tried different permutations in the web.config file. such as
or tried this amendment in 'UmbracoStandardOwinStartup.cs'
[assembly: OwinStartup("UmbracoStandardOwinStartup", typeof(demoProject.UmbracoStandardOwinStartup))]
But still the error prevails. If I make the web.config entry
Setting up UmbracoCms.IdentityExtensions - but receiving errors
Hi,
I am trying to set up a custom Umbraco Back Office Login for Umbraco 7.8.1. I have read a lot of articles on line about UmbracoCms.IdentityExtensions, that can be extended to use Google/Facebook login etc.
I have performed the following steps.
this is the code for 'UmbracoStandardOwinStartup.cs'
Within the web.config I have added the line in side the appSettings.
these lines have been added into the web.config as well.
When I now run the project I get the following error.
The following errors occurred while attempting to load the app. - The OwinStartupAttribute.FriendlyName value 'UmbracoDefaultOwinStartup' does not match the given value 'UmbracoStandardOwinStartup' in Assembly 'umbraco, Version=1.0.6614.16987, Culture=neutral, PublicKeyToken=null'. - The given type or method 'UmbracoStandardOwinStartup' was not found. Try specifying the Assembly. To disable OWIN startup discovery, add the appSetting owin:AutomaticAppStartup with a value of "false" in your web.config. To specify the OWIN startup Assembly, Class, or Method, add the appSetting owin:AppStartup with the fully qualified startup class or configuration method name in your web.config.
I have tried different permutations in the web.config file. such as
or
or tried this amendment in 'UmbracoStandardOwinStartup.cs' [assembly: OwinStartup("UmbracoStandardOwinStartup", typeof(demoProject.UmbracoStandardOwinStartup))]
But still the error prevails. If I make the web.config entry
Then the umbraco project loads, but I assume this is the actual (umbraco) default and the startup code does not get fired, in the App_Startup
I have searched online for help, but am unable to find a solution.
Any thoughts.
thanks
is working on a reply...