This repository was archived by the owner on Jul 17, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 17, 2024. It is now read-only.
oxide auth login not working - "Credentials missing or invalid" #230
Copy link
Copy link
Closed
oxidecomputer/omicron
#1359Description
Using release 0.2.6, I tried the following:
$ oxide --debug auth login
Oxide instance host (this assumes https:// unless http:// is given as a part of the URL): http://mercury.oxide-preview.com/
Jul 06 20:06:29.628 DEBG starting new connection: http://mercury.oxide-preview.com/
Jul 06 20:06:29.830 DEBG response '200 OK' for http://mercury.oxide-preview.com/device/auth
Opening http://mercury.oxide-preview.com/device/verify in your browser.
Please verify user code: MQPZ-GRKJ
Jul 06 20:06:30.144 DEBG starting new connection: http://mercury.oxide-preview.com/
Jul 06 20:06:30.349 DEBG response '400 Bad Request' for http://mercury.oxide-preview.com/device/token
Jul 06 20:06:35.350 DEBG starting new connection: http://mercury.oxide-preview.com/
Jul 06 20:06:35.608 DEBG response '400 Bad Request' for http://mercury.oxide-preview.com/device/token
At this point, I went to the console, hit the button, and came back:
Jul 06 20:06:40.609 DEBG starting new connection: http://mercury.oxide-preview.com/
Jul 06 20:06:40.816 DEBG response '200 OK' for http://mercury.oxide-preview.com/device/token
Jul 06 20:06:40.816 DEBG request: RequestBuilder { method: GET, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("mercury.oxide-preview.com")), port: None, path: "//session/me", query: None, fragment: None }, headers: {"accept": "application/json", "content-type": "application/json", "authorization": "Bearer oxide-token-eb6eb0700e09a36e7060f5deb1e72f6a8cdfc479"} }
Jul 06 20:06:40.816 DEBG starting new connection: http://mercury.oxide-preview.com/
Jul 06 20:06:41.021 DEBG response '401 Unauthorized' for http://mercury.oxide-preview.com//session/me
✘ You are not authenticated: credentials missing or invalid
Try authenticating with: `oxide auth login`
In the Nexus log, I saw the following:
{"msg":"request completed","v":0,"name":"nexus","level":30,"time":"2022-07-06T20:07:10.410363035Z","hostname":"oxz_nexus","pid":16537,"uri":"//session/me","method":"GET","req_id":"b1b13a1e-2ca3-4baf-bcd0-8ba68987d490","remote_addr":"172.20.16.122:59858","local_addr":"172.20.15.226:80","component":"dropshot_external","name":"e6bff1ff-24fb-49dc-a54e-c6a350cd4d6c","error_message_external":"credentials missing or invalid","error_message_internal":"Actor required","response_code":"401"}
Metadata
Metadata
Assignees
Labels
No labels
Activity
smklein commentedon Jul 6, 2022
FYI @plotnick , @davepacheco
smklein commentedon Jul 6, 2022
Not sure what the "Actor required" message means in this context. Is it invalid to authenticate before setting up something else in the system?
FWIW, at this point, I was booting a fresh Omicron with no silo / IdP info set up.
plotnick commentedon Jul 6, 2022
Who did you log in as in the console?
smklein commentedon Jul 6, 2022
I pressed the "Privileged" button when the option showed up
smklein commentedon Jul 6, 2022
I'm able to repro the same behavior with the "Unprivileged" user - still seeing
401 unauthorizedforsession/mesmklein commentedon Jul 6, 2022
The error message from Nexus comes from:
https://github.com/oxidecomputer/omicron/blob/9c1fab7d183d9ae93f518e9d1e08648aa6d0f62b/nexus/src/authn/mod.rs#L76-L87
This implies that the
opctxcreated here is not authenticated:https://github.com/oxidecomputer/omicron/blob/9c1fab7d183d9ae93f518e9d1e08648aa6d0f62b/nexus/src/external_api/console_api.rs#L547-L565
plotnick commentedon Jul 6, 2022
Ugh, not really sure what's going on here. The token is being granted and used for authentication, so it should be looked up and assigned an actor by the code in
authn/external/token.rs. What omicron commit is this running against? Could you connect to the Cockroach DB and runselect * from device_access_token;?plotnick commentedon Jul 6, 2022
Also happy to pair on this if you'd like, before, during or after the demo dry-run. Just ping me in chat.
smklein commentedon Jul 6, 2022
Adding
client_tokentoschemes_externalcaused this to work, in the Nexus configsmklein commentedon Jul 6, 2022
Specifically, within
smf/nexus/config-partial.tomlplotnick commentedon Jul 6, 2022
Should also generate traces for attempted authn mechanisms to assist debugging.
bnaecker commentedon Jul 6, 2022
@plotnick If the system is live, and those messages are logged at a filtered level like trace, you can get them with DTrace:
pfexec dtrace -n 'slog*:::trace { printf("%\n", copyinstr(arg0)); }'will print the whole trace message as JSON.davepacheco commentedon Jul 6, 2022
That explains all of this, right? Nexus was configured not to look at the device auth token scheme.
plotnick commentedon Jul 6, 2022
Correct. Should be fixed in Omicron#1359.