question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Accessing the registration page with UAA [v4.9.0]

See original GitHub issue
Overview of the issue

When using JHipster 4.9.0 and UAA, there is an issue with accessing the registration page. There is 401 Unauthorized error in the browser’s console (as the result of the GET request to http://localhost:8080/uaa/api/account).

Motivation for or Use Case

Registrations should be possible in the out of the box, generated version.

Reproduce the error

You have to generate an app with UAA through JHipster 4.9.0.

Related issues

I’m not aware of this.

Suggest a Fix

There were a changes in UAA recently. From the first overview I found generator-jhipster/generators/client/templates/angular/src/main/webapp/app/shared/auth/_user-route-access-service.ts as the reason of the problem.

Previously when the route had no authorities, checkLogin was not executed. Problem has to be related with principal.identity(), executed inside checkLogin.

The quickfix for me was to copy

if (!authorities || authorities.length === 0) {
    return true;
}

back to its original place, but it was moved from there for a purpose

// We need to call the checkLogin / and so the principal.identity() function, to ensure,
// that the client has a principal too, if they already logged in by the server.
// This could happen on a page refresh.

I’d say, the target solution requires a better understanding of principal.identity() and rethinking it with the recently registered user in mind.

JHipster Version(s)

4.9.0

JHipster configuration
JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "io.github.mat3e.jhipster.taskr",
      "nativeLanguage": "pl"
    },
    "jhipsterVersion": "4.9.0",
    "baseName": "uaa",
    "packageName": "io.github.mat3e.jhipster.taskr",
    "packageFolder": "io/github/mat3e/jhipster/taskr",
    "serverPort": "9999",
    "authenticationType": "uaa",
    "hibernateCache": "no",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "mongodb",
    "devDatabaseType": "mongodb",
    "prodDatabaseType": "mongodb",
    "searchEngine": false,
    "messageBroker": "kafka",
    "serviceDiscoveryType": "consul",
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "applicationType": "uaa",
    "testFrameworks": [
      "cucumber"
    ],
    "jhiPrefix": "jhi",
    "skipClient": true,
    "nativeLanguage": "pl",
    "languages": [
      "pl",
      "en"
    ],
    "clientPackageManager": "yarn"
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

No entities in UAA.

Environment and Tools

java version “1.8.0_121” Java™ SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot™ Client VM (build 25.121-b13, mixed mode)

git version 2.9.0.windows.1

node: v8.2.1

npm: 5.3.0

bower: 1.7.9

yeoman: 2.0.0

yarn: 0.27.5

Docker version 17.06.2-ce, build cec0b72

docker-compose version 1.14.0, build c7bdf9e3

Browsers and Operating System

I’m working on Windows.

  • Checking this box is mandatory (this is just to show you read everything)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
xetyscommented, Oct 1, 2017

So…option 3: “AntiUserRouteAccessService” 😆

1reaction
gzsomborcommented, Oct 1, 2017

I’ve moved the lines, because of #6190 and #6413 . The register route should have an opposite rule - if the user logged in, they shouldn’t be allowed to see the page

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dates and Deadlines - University of Alaska Anchorage
Information about student dates and deadlines, registration process and changing registration at the University of Alaska Anchorage.
Read more >
How to Register | Students - University of Alaska Anchorage
Go to UAOnline and click the "Log In" link. Enter UA username and password (the same credentials for Blackboard or UAA e-mail). Current...
Read more >
Creating Your UA Account & Registering | Students
Creating Your University Account. Once you have submitted your application you will need to create your University of Alaska account.
Read more >
Banner Support | Office of Information Technology
UA System Employees please download and complete the Administrative Access Request Form and submit it to the appropriate Campus Security Coordinator.
Read more >
Middle College Advising | About UAA
Middle College advisors add registration holds to all AMCS student's UAA accounts. Holds are added to ensure students submit their midterm progress reports, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found