Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

Ensure User-Agent is sent #67

Open
nbarbettini opened this issue Jan 31, 2019 · 3 comments
Open

Ensure User-Agent is sent #67

nbarbettini opened this issue Jan 31, 2019 · 3 comments
Labels
Milestone

Comments

@nbarbettini
Copy link

Verify that this SDK sends a User-Agent header whenever it:

  • Retrieves the OpenID Connect metadata document (/.well-known/openid-configuration)
  • Exchanges an authorization code for tokens, for both browser or native sign-in

The value of the header must be:

User-Agent: okta-sdk-appauth-android/{version} {osVersion} {deviceInfo}

The SDK may already be doing this in all cases, but I want to double check 🙂

More info can be found here: https://oktawiki.atlassian.net/wiki/spaces/PM/pages/237672215/User-Agent+and+X-Okta-User-Agent-Extended

@nbarbettini nbarbettini added this to the 0.3.0 milestone Jan 31, 2019
@bdemers
Copy link
Contributor

bdemers commented Jan 31, 2019

When usage of the management or authn sdk, just create a META-INF/okta/version.properties file with the format of:

okta-sdk-appauth-android=${version-at-build-time}

https://github.com/okta/okta-jwt-verifier-java/blob/master/impl/src/main/resources/META-INF/okta/version.properties

For appAuth usage, the easiest way to implement the same format is to depend on com.okta.commons:okta-commons-lang and use ApplicationInfo

Though all of these options depend on Java8 functionality, so you might need to port this logic , maybe just this method:?
https://github.com/okta/okta-commons-java/blob/master/lang/src/main/java/com/okta/commons/lang/ApplicationInfo.java#L311-L322

@smokienko
Copy link

@nbarbettini Currently our SDK sends User-Agent token only as a part of Authorized requests.
In order to change "User-Agent" header for token exchange and Open Id Config request, we need to override those requests within AppAuth code. We can do it as a part of moving from AppAuth SDK.

@nbarbettini
Copy link
Author

@smokienko Makes sense. Bubbling this up again so we don't lose it when talking about migrating from AppAuth.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants