Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/D2L.Bmx/Okta/Models/OktaSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ internal record OktaSession(
string Id,
string Login,
string UserId,
string Status,
DateTimeOffset CreatedAt,
DateTimeOffset ExpiresAt
);
8 changes: 8 additions & 0 deletions src/D2L.Bmx/OktaAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,14 @@ string browserPath

var oktaAuthenticatedClient = oktaClientFactory.CreateAuthenticatedClient( orgUrl, sessionId );
var oktaSession = await oktaAuthenticatedClient.GetCurrentOktaSessionAsync();
if( oktaSession.Status != "ACTIVE" ) {
messageWriter.WriteWarning( """
Okta passwordless authentication failed.
An active session ID was not returned from Okta.
""" );

@cfbao cfbao May 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirming - is this behaviour consistent with when passwordless auth fails for other reasons (e.g. browser asking for password)? like we're printing the same style of warning messages?

I also wonder if "An active session ID was not returned from Okta" is too detailed and unhelpful. Maybe we can reuse a generic failure message for passwordless auth failures (mostly due to users' network environment)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is this one but the rest are kind of generic and don't give a specific reason and I can see why this wouldn't be super helpful for the user - especially since it doesn't tell them it's probably related to just closing zscaler but that seems weird to add in since it's specific to us.

I don't think we have a generic output message but I could just reword it to Okta did not provide expected response

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm more thinking of these:

if( url.AbsolutePath == "/" ) {
messageWriter.WriteWarning( "Okta passwordless authentication is not available." );
} else {
messageWriter.WriteWarning( "Okta passwordless authentication failed" );
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Okta passwordless authentication failed" is appropriate here.
also they're behind the debug flag, so this should be the same.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no real difference between this inactive session failure and the "browser asking for password" failure, so they should behave the same

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh okay I can go with that then

return null;
}

string sessionLogin = oktaSession.Login.Split( "@" )[0];
string providedLogin = user.Split( "@" )[0];
if( !sessionLogin.Equals( providedLogin, StringComparison.OrdinalIgnoreCase ) ) {
Expand Down
Loading