Project

General

Profile

Feature #40344

Add API endpoint to pass MIDDLEWARE_TOKEN to web UI

Added by Erin Clark about 2 years ago. Updated about 2 years ago.

Status:
Done
Priority:
No priority
Assignee:
William Grzybowski
Category:
Middleware
Target version:
Estimated time:
Severity:
High
Reason for Closing:
Reason for Blocked:
Needs QA:
No
Needs Doc:
No
Needs Merging:
No
Needs Automation:
Yes
Support Suite Ticket:
n/a
Hardware Configuration:

Description

As per #38783, I need an api endpoint that gives me an html page with a token stored in a javascript global variable to authenticate the UI with.


Related issues

Blocks FreeNAS - Bug #38783: Add ability to log directly into new UI with a tokenDone

Associated revisions

Revision 08da3ea2 (diff)
Added by William Grzybowski about 2 years ago

feat(middlewared): add endpoint to pass MIDDLEWARE_TOKEN to webui TrueView needs a way to authenticate to new UI automatically, using query string poses a security risk since that can be seen very easily. We validate the auth_token and then output MIDDLEWARE_TOKEN as a javascript variable in the index.html output. Ticket: #40344

Revision 83d0a6eb (diff)
Added by William Grzybowski about 2 years ago

feat(middlewared): add endpoint to pass MIDDLEWARE_TOKEN to webui TrueView needs a way to authenticate to new UI automatically, using query string poses a security risk since that can be seen very easily. We validate the auth_token and then output MIDDLEWARE_TOKEN as a javascript variable in the index.html output. Ticket: #40344

Revision d64c6e82 (diff)
Added by William Grzybowski about 2 years ago

fix(middlewared): use text/html content type Ticket: #40344

Revision 19b8fc08 (diff)
Added by William Grzybowski about 2 years ago

fix(middlewared): use text/html content type Ticket: #40344

History

#1 Updated by Erin Clark about 2 years ago

  • Blocks Bug #38783: Add ability to log directly into new UI with a token added

#2 Updated by William Grzybowski about 2 years ago

  • Category changed from GUI (new) to Middleware
  • Status changed from Unscreened to Not Started

#3 Updated by Bug Clerk about 2 years ago

  • Status changed from Not Started to In Progress

#4 Updated by William Grzybowski about 2 years ago

  • Status changed from In Progress to Ready for Testing

POST /ui
auth_token=XXXX (as form-data)

It will output <script>var MIDDLEWARE_TOKEN="XXXX";</script> in the index.html, before </head>.

#5 Updated by Dru Lavigne about 2 years ago

  • Subject changed from Need api for getting html page with token global variable for authentication. to Add API endpoint to pass MIDDLEWARE_TOKEN to web UI
  • Needs Doc changed from Yes to No
  • Needs Merging changed from Yes to No

#6 Updated by Dru Lavigne about 2 years ago

#7 Updated by Erin Clark about 2 years ago

  • Status changed from Ready for Testing to Failed Testing

This almost works, however the index file I get displays in plain text rather than getting loaded into the browser. This may need a mime type set for the output.

#8 Updated by Bug Clerk about 2 years ago

  • Status changed from Failed Testing to In Progress

#9 Updated by William Grzybowski about 2 years ago

  • Needs Automation changed from No to Yes

#10 Updated by Bug Clerk about 2 years ago

  • Status changed from In Progress to Ready for Testing

#11 Updated by Dru Lavigne about 2 years ago

  • Status changed from Ready for Testing to Done
  • Needs QA changed from Yes to No

Also available in: Atom PDF