What is the url for aws cognito login for the android sdk

260 Views Asked by At

I made an android app that uses the aws cognito sdk to login to a user pool. This returns the 3 tokens (id, access, refresh) and I can then call my api gateway. This all works, no problems. However, when I am debugging the app I can't see the call that my app makes to cognito to get these tokens. I have tried adding the verbose logging as per https://docs.aws.amazon.com/mobileanalytics/latest/ug/sdk-logging.html but that hasn't worked. There are 5 endpoints described in the docs https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-userpools-server-contract-reference.html but none of them seem to take in the username/password.

1

There are 1 best solutions below

0
Roshan On

SDK uses Apache Commons Logging library(JCL) if it is present in the classpath else it uses android.util.Log. Using JCL: JCL is a wrapper for popular logging APIs such as Log4J, logback etc. If your app does not take a dependency on any of these, common logging library defaults to java.util.logging package present in JDK. Configuration of the behavior of the JCL ultimately depends upon the logging toolkit(log4j, logback etc.) being used. Please refer the documentation for the chosen logging system to adjust the log level. If you are defaulting to java.util.logging package, you can change log level as follows :

Add logging.properties file to res/raw and add following to onCreate of the MainActivity

logger = Logger.getLogger(PubSubActivity.class.getName());
InputStream raw = getResources().openRawResource(R.raw.logging);
LogManager lManager = LogManager.getLogManager();
lManager.readConfiguration(raw);

Using Android Log : There is no way to change log level for entire SDK in this case. However as a workaround to change log levels for debugging purposes you can change it for a specific tag with the following command: adb shell setprop log.tag.<YOUR_LOG_TAG> <LEVEL>