Thanks for releasing the Identity service, and I hope your move was successful!
I’m trying to do a basic setup of the identity service in Squidex cloud, but falling at the first hurdle. I don’t even know how to access the login screen of my identity app, nevermind add new identity providers.
The next step for me will be to see if it can be integrated into a Xamarin.Forms app, to use as a general identity provider for the app.
I know that it’s only in Alpha which is why the documentation is limited. Is there any basic information that you can share which could help me? I’m happy to help put this into a quick start guide if that’s needed, I’m just totally stuck for the moment, perhaps because I don’t have much experience working with identity management systems.
First of all: The identity service is not integrated into our cloud yet and I am not sure if it will ever be, because there are some restrictions with the identity system in asp.net core that are hard to handle.
You have to host it by yourself. If you want I can also host it for you.
The external authentication providers are called “Authentication Schemas” in our schemas and I hope there are relatively straight forward to add. You also need a client for your app.
Ok I didn’t realise I needed a standalone version. I’ll have a go at setting up my own server and go from there.
Maybe a quick check to see if my use case is feasible before I go down that route. I want to use Squidex Identity as an Identity Server for a Xamarin app.
My plan is to configure Xamarin.Auth to authenticate with Squidex identity using either email address or social network account, so I don’t need to write code for each separate social network.
Is that use case possible? The bit I’m not really sure of is how the social network integration would work.
Hi Strak, this is exactly the use case that Squidex Identity is designed for. It is a wrapper around IdentityServer, which is an implementation for OAuth and OpenId Connect, just like Auth0.
Ok, it’s actually the bit about displaying Facebook login, page, reset password flow, etc. from within the app that’s confusing me.
As a browser will need to be launched to show Facebook login for example, I can’t see how I can do that through Squidex identity. I know there’s a web login form provided, but I don’t see how I can do those things from a Xamarin app.
I can’t quite get my head round the theory, I think I just need to try it!
Ok, trying to run the docker image from Windows. I assumed that I needed to run a windows container, but had the following error:
C:\WINDOWS\system32>docker run squidex/squidex-identity:dev
Unable to find image ‘squidex/squidex-identity:dev’ locally
dev: Pulling from squidex/squidex-identity
docker: image operating system “linux” cannot be used on this platform.
See ‘docker run --help’.
After switching to Linux containers, I get this:
C:\WINDOWS\system32>docker run squidex/squidex-identity:dev
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused “exec: “dotnet”: executable file not found in $PATH”: unknown.
It is a linux container, which was broken. But I fixed it now. You also need a MongoServer because I have some small data to be stored. But it should be very easy to write providers for other databases, I would be happy to see a PR there.
Now I have a different problem. I don’t think I’ve changed anything but I can no longer run the app. I get the following error.
SquidexException: The app, schema or entity does not exist.
Squidex.ClientLibrary.SquidexClientBase.EnsureResponseIsValidAsync(HttpResponseMessage response, string token)
I think it’s communicating with Squidex cloud and my identity app because if I change any of the appName, clientId or clientSecret I get a different error. I’ve also created a new identity app, but still get the same error. App details below.
It’s as soon as I run the app from Visual Studio. Here’s the stack trace:
SquidexException: The app, schema or entity does not exist.
Squidex.ClientLibrary.SquidexClientBase.EnsureResponseIsValidAsync(HttpResponseMessage response, string token)
Squidex.ClientLibrary.SquidexClientBase.RequestAsync(HttpMethod method, string path, HttpContent content, QueryContext context)
Squidex.ClientLibrary.SquidexClient<TEntity, TData>.GetAsync(string id, QueryContext context)
Squidex.Identity.Extensions.PageModelBase<TDerived>.GetUserAsync() in PageModelBase.cs
+
var user = await UserManager.GetUserAsync(User);
Squidex.Identity.Extensions.ManagePageModelBase<TDerived>.OnPageHandlerExecutionAsync(PageHandlerExecutingContext context, PageHandlerExecutionDelegate next) in ManagePageModelBase.cs
+
UserInfo = await GetUserAsync();
Microsoft.AspNetCore.Mvc.RazorPages.Internal.PageActionInvoker.InvokeInnerFilterAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextResourceFilter()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeFilterPipelineAsync()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeAsync()
Microsoft.AspNetCore.Builder.RouterMiddleware.Invoke(HttpContext httpContext)
IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events) in IdentityServerMiddleware.cs
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Cors.Infrastructure.CorsMiddleware.Invoke(HttpContext context)
IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) in BaseUrlMiddleware.cs
Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.MigrationsEndPointMiddleware.Invoke(HttpContext context)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.DatabaseErrorPageMiddleware.Invoke(HttpContext httpContext)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
I’m pretty sure I have the client details correct, and I can see that there’s some sort of connection as the number of API calls is increasing.
I tried deleting everything again, and took a new clone from Git. When I leave the settings as your original identity-test app it does load the page with no error.
When I change to the client details below I get an error, so it must be either something I’m setting incorrectly, or something in my Squidex app which isn’t working.
I can’t understand what has happened as it was working early yesterday evening, or why I can connect using the squidex cloud app with the settings included in the Git.
Is it possible that there’s an issue with my Squidex cloud account? Are there any other configuration settings that have been added in the last update?