Skip to content

use identity engine cookie for passwordless - #532

Merged
gord5500 merged 4 commits into
mainfrom
use_identity_engine_cookie_for_passwordless
Sep 23, 2026
Merged

gord5500 merged 4 commits into
mainfrom
use_identity_engine_cookie_for_passwordless

Conversation

@gord5500

@gord5500 gord5500 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Why

Add a bandaid fix for BMX to support Okta Identity Engine along with the Classic Engine

Ticket

VUL-3855 - BMX > Stopgap for auto login failure

@gord5500
gord5500 marked this pull request as ready for review September 18, 2026 18:41
@gord5500
gord5500 requested a review from a team as a code owner September 18, 2026 18:41
Comment thread src/D2L.Bmx/OktaAuthenticator.cs Outdated
Comment on lines +243 to +245
// DSSO can sometimes take more than one attempt. Both this terminal page and the
// transient Agentless DSSO page have "Sign In" titles, so only retry from this path.
if( url.AbsolutePath.Equals( "/oauth2/v1/authorize", StringComparison.OrdinalIgnoreCase ) ) {

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.

In my browser dev tool I'm not seeing this URL as the terminal page.

I suspect you were seeing some race conditions. IIUC, page loads/refreshes don't wait for await in this event handler OnPageLoadAsync, so you could be seeing "sign in" title from a later loaded page but with URL from an earlier page?

@cfbao cfbao Sep 21, 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.

/oauth2/v1/authorize returns a 302 with no body, so it can't have a title at all.
the terminal page is /login/agentlessDsso/idx?stateToken=...

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.

Hmm yea I guess we are maybe killing the attempt too early then since when we see that url we retry? I can see where it ends up. That probably would only help with debugging though since this url (seemingly?) only gets hit off vpn?

Probably a small amount of time but is there an other reason to not exit as early as we could if we know the attempt won't work? I didn't do this deliberately though since that original text check was already there so I'm down for whatever. I am not sure about the title though - maybe it's a Puppeteer thing?

Attempting Okta passwordless authentication...
Launching browser: C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe
Creating new browser tab
Navigating to https://d2l.okta.com/
Browser loaded https://d2l.okta.com/app/UserHome with title ''
Browser loaded https://d2l.okta.com/oauth2/v1/authorize with title 'D2L Corporation - Sign In'
Attempt 1 failed. Retry...
Browser loaded https://d2l.okta.com/oauth2/v1/authorize with title 'D2L Corporation - Sign In'
Attempt 2 failed. Retry...
Browser loaded https://d2l.okta.com/oauth2/v1/authorize with title 'D2L Corporation - Sign In'
Okta passwordless authentication is not available

cfbao
cfbao previously approved these changes Sep 22, 2026
if( BmxEnvironment.IsDebug ) {
messageWriter.WriteWarning( $"Browser loaded {page.Url}" );
messageWriter.WriteWarning(
$"Browser loaded {url.GetLeftPart( UriPartial.Path )} with title '{title}'"

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 assume this is to hide the query string which can contain somewhat sensitive parameters?
would be good to include a comment explaining this

@gord5500
gord5500 merged commit 91da9c0 into main Sep 23, 2026
17 checks passed
@gord5500
gord5500 deleted the use_identity_engine_cookie_for_passwordless branch September 23, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants