Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Provide all of these Segments with the Semantic tag permission.

Create

...

Login App Instance

Go to Tools / Apps / Login and Authorization and create a new instance:

...

Codeblock
gradle setup run

Create a simple node / express based web app

Open a second console window and clone the tutorial’s Git repo if you haven’t already done so:

Codeblock
git clone https://gitext.pinuts.de/um-public/tutorial-login-app.git

Start the sample web app using yarn:

Codeblock
cd tutorial-login-app/my-app
yarn
yarn dev

The sample web app contains a /user route, that reads the UMSESSIONID cookie and performs a GET request against an API endpoint (/cmsbs/rest/de.pinuts.cmsbs.auth2.Auth/c.json/[login-app-instance-name]) provided by UM's Login App to retrieve information about the logged-in web user: my-app/index.js

This API endpoint returns an empty user profile, if the current user has not logged-in successfully:

Codeblock
languagejson
{
  "data": {
    "ses": null,
    "config": {
      "rememberMe": false,
      "rememberMeDefault": false
    },
    "rememberMeLogin":false
  }
}

It returns a fully populated user profile if the user has logged-in successfully:

Codeblock
languagejson
{
  "data": {
    "ses": {
      "_pi": "my-app",
      "lastLogin": "2021-09-29|17:00:35",
      "loginIp": "127.0.0.1",
      "loggedIn": true,
      "authPass": true,
      "authCookie": false,
      "uid": "2333484",
      "firstname": "Bob",
      "lastname": "",
      "email": "bob@acme.com",
      "cookie": "b0779317014e0fa066efbf0621dc3bfc",
      "_permissions": ["perm1", "perm3"],
      "logoutUnconfirmed": false
    },
    "config": {
      "rememberMe": false,
      "rememberMeDefault": false
    },
    "rememberMeLogin": false
  }
}

Give it a try

Now, you should be able to login to your sample web app using the custom users' credentials you created earlier: http://localhost:8000/

...