SDK

Android SDK Troubleshooting

Last updated Apr 7, 2020

This article contains information on how to diagnose issues within the application, or with communication to the ForgeRock Identity Platform.


Enable Debug Logging

To enable debug logging, add the following line to your Java code:

Logger.set(Logger.Level.DEBUG);

Log Format

The ForgeRock SDK for Android outputs the following types of debug log messages:

General

Format:

<Log Level>ForgeRock: [<SDK Version>] [<Class Name>] <Message>

Sample:

I/ForgeRock: [1.0] [DefaultTokenManager]: Using SharedPreference: SecuredSharedPreferences
W/ForgeRock: [1.0] [DefaultSingleSignOnManager]: Single Sign On is disabled due to: ComponentInfo{com.example.forgerocksdktutorial/org.forgerock.android.auth.authenticator.AuthenticatorService}
I/ForgeRock: [1.0] [InterceptorHandler]: Processing interceptor: RetrieveAccessTokenInterceptor
I/ForgeRock: [1.0] [InterceptorHandler]: Processing interceptor: RetrieveSSOTokenInterceptor

Networking

Network debug logs use the com.squareup.okhttp3:logging-interceptor package.

Sample:

I/ForgeRock: [1.0] [OAuth2Client]: Exchange Access Token with Authorization Code
D/OkHttp: --> POST http://openam.example.com:8080/openam/oauth2/realms/root/access_token
          Content-Type: application/x-www-form-urlencoded
D/OkHttp: Content-Length: 245
          Accept-API-Version: resource=2.1, protocol=1.0
D/OkHttp: client_id=ForgeRockSDKClient
            &code=rkFN..yq2c
            &redirect_uri=http%3A%2F%2Fwww.example.com%2Fcallback
            &grant_type=authorization_code
            &code_verifier=wtG..2p7Q
D/OkHttp: --> END POST (245-byte body)
D/OkHttp: <-- 200 http://openam.example.com:8080/openam/oauth2/realms/root/access_token (151ms)
          X-Frame-Options: SAMEORIGIN
          X-Content-Type-Options: nosniff
          Cache-Control: no-store
          Pragma: no-cache
          Content-Type: application/json;charset=UTF-8
          Content-Length: 1067
          Date: Fri, 29 Nov 2019 13:24:15 GMT
D/OkHttp: { "access_token":"hphST..LjJE",
            "scope":"address phone openid profile email",
            "id_token":"eyJ0eXAi..LKRyw",
            "token_type":"Bearer",
            "expires_in":3599 }
          <-- END HTTP (1067-byte body)


Copyright and TrademarksCopyright © 2020 ForgeRock, all rights reserved.
Loading...