Requesting a User to Authenticate

To separate the concerns, your app should not directly deal with user authentication. Rather than that, it should have a view that blends in an authentication view from another app that deals with that.

Below instruction shows how to provide an authentication notice that blends in the authentication form from the SignIn app.

When your app decides that the view cannot be presented without authentication, it redirects to its own "Unauthenticated" view.
For example: /your-app/partial/unauthenticated?return_uri={?}

The "unauthenticated" view model could be associated with a "Unautheticated.html" which defines a warning message about not being authenticated. The main purpose for this partial is to provide the mapping to the authentication view coming from the SignIn app using a predifined token.

{

"Html":"/people/viewmodels/Unauthenticated.html"

}

using Starcounter;

​

namespace Your-App

{

partialclassUnauthenticated:Json

{

}

}

<template>

<templateis="dom-bind">

<div>

<iron-iconicon="icons:warning"></iron-icon>

<label>You need to be signed in to use People.</label>

</div>

</template>

</template>

It should be mapped to a token userform-return, which is understood in other apps