Skip to content

feat: Support WebAuth application context - #356

Open
baksha97 wants to merge 1 commit into
okta:masterfrom
baksha97:travis/agnostic-context
Open

feat: Support WebAuth application context#356
baksha97 wants to merge 1 commit into
okta:masterfrom
baksha97:travis/agnostic-context

Conversation

@baksha97

@baksha97 baksha97 commented Jan 13, 2026

Copy link
Copy Markdown

This change enables web authentication to be launched during application startup when bootstrapping Okta.

Without this, a custom WebAuthenticationProvider that supports an application context would still fail, as the Android runtime throws an error when resolving the ForegroundActivity intent.

The update allows launching ForegroundActivity explicitly using an application context instead of implicitly depending on an activity context.

This should be a safe approach since:

  • ForegroundActivity should only be launched by a user interaction to trigger web auth
  • ForegroundActivity is not an exported activity since it's internal to Okta's implementation
  • This approach is typically used for bridge activities to acquire foreground state; which looks to be the intent of ForegroundActivity.

@baksha97 baksha97 changed the title feat: Support non-activity context feat: Support WebAuth non-activity context Jan 13, 2026
@baksha97 baksha97 changed the title feat: Support WebAuth non-activity context feat: Support WebAuth application context Jan 13, 2026
@rajdeepnanua-okta

Copy link
Copy Markdown
Contributor

Hi @baksha97, thanks for your contribution. This looks great, but we don't want to launch ForegroundActivity as new task if the provided context is an Activity. We do already capture application context in this SDK, so we may be able to provide a login function for web login that doesn't take in a context. @FeiChen-okta, I think this is an interesting use case and something we can support with not too much changes

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