0
votes

I have a web app and a mobile app that I would like to share the same authentication. When the user goes to .auth/login/aad (for example), I am able to get the aad claims directly. When the user uses zumo on a mobile app, I can use the ProviderCredentials to get the matching aad claims. Is there a "generateSid" function I can use to take the web app login aad claims and generate the zumo sid so that they match?

To get the user claims from the web app side, I use

    private Response FlowPrincipal(NancyContext context)
    {
        var env = Get<IDictionary<string, object>>(context.Items, NancyMiddleware.RequestEnvironmentKey);
        if (env != null)
        {
            var principal = Get<IPrincipal>(env, "server.User") as ClaimsPrincipal;
            if (principal != null)
            {
                context.CurrentUser = new ClaimsPrincipalUserIdentity(principal);
            }
        }

        return null;
    }

This gives me a user id directly from aad, but not from zumo (the "sid").

enter image description here

It takes a query to the server to go from the zumo token to the aad details. I'm wondering if there is a way to go from this login to the zumo sid.

1

1 Answers

1
votes

You can do what you need directly, and I've documented this exact scenario in my book at http://aka.ms/zumobook in chapter 2 (Enterprise Authentication), with complete code samples.