question

lotussea avatar image
lotussea asked

amazon cloud drive nodelist no token error

nodelist requests issue " com.amazon.clouddrive.exceptions.AuthorizationException: No token " - amazon cloud drive app registred 1.registered security profile. 2.registered whitelist please help me !
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, Thanks for posting. Any more information would be appreciated. What are you actually trying to do? Feel free to post the code you're using and we will investigate to see what is going wrong. Thanks! Jamie
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lotussea avatar image
lotussea answered
Thanks for Answering. I'm WhiteList completed ( Scope : read & write) also completed security profile settings. I tried nodelist. public static final String[] APP_CLOUD_SCOPES = { "profile", "clouddrive:read_all", "clouddrive:write" }; ListNodesRequest listNodesRequest = new ListNodesRequest(); listNodesRequest.setFilters("isRoot:true"); ListNodesResponse listNodesResponse = mAmazonCloudDriveClient.listNodes(listNodesRequest); Please confirm. ===================== log ========================= D/com.amazon.identity.auth.device.endpoint.TokenVendor.PII? Vending out token: appId=amzn1.application.5a425c1530fd4dddbeccbf073d5c523f, scopes=[profile, clouddrive:read_all, clouddrive:write]: W/com.amazon.identity.auth.device.endpoint.TokenVendor? RequestedScope shouldn't be null!!!! - null, but continuing anyway... I/com.amazon.identity.auth.device.endpoint.TokenVendor? Try finding a common access token for requested scopes I/com.amazon.identity.auth.device.endpoint.TokenVendor? Common access token not found! I/com.amazon.identity.auth.device.endpoint.TokenVendor? Try finding a common refresh token for requested scopes I/com.amazon.identity.auth.device.endpoint.TokenVendor? Common refresh token not found! D/com.amazon.identity.auth.device.endpoint.TokenVendor.PII? Updating existing token: I/com.amazon.identity.auth.device.authorization.ThirdPartyServiceHelper? Inside getRemoteAndroidService AsyncTask - Attempting remote service D/com.amazon.identity.auth.device.authorization.ThirdPartyServiceHelper? getAuthorizationServiceInstance I/com.amazon.identity.auth.device.authorization.ThirdPartyServiceHelper? Number of services found : 0 I/com.amazon.identity.auth.device.authorization.ThirdPartyServiceHelper? Number of MAP services to compare = 0 I/com.amazon.identity.auth.device.authorization.ThirdPartyServiceHelper? Returning no service to use I/com.amazon.identity.auth.device.authorization.ThirdPartyServiceHelper? Unbinding Highest Versioned Service D/com.amazon.identity.auth.device.authorization.TokenHelper.PII? GetToken: W/System.err? com.amazon.clouddrive.exceptions.AuthorizationException: No token W/System.err? at com.amazon.clouddrive.auth.AmazonAuthorizationConnectionFactory.createHttpURLConnection(AmazonAuthorizationConnectionFactory.java:68) W/System.err? at com.amazon.clouddrive.internal.AbstractCloudDriveOperation.setUpConnection(AbstractCloudDriveOperation.java:68) W/System.err? at com.amazon.clouddrive.internal.CloudDriveMethodOperation.retryCall(CloudDriveMethodOperation.java:88) W/System.err? at com.amazon.clouddrive.internal.AbstractCloudDriveOperation.call(AbstractCloudDriveOperation.java:112) W/System.err? at com.amazon.clouddrive.internal.RequestPathGenerator.getInitializedEndpoints(RequestPathGenerator.java:47) W/System.err? at com.amazon.clouddrive.internal.RequestPathGenerator.access$200(RequestPathGenerator.java:17) W/System.err? at com.amazon.clouddrive.internal.RequestPathGenerator$RequestPath.getPath(RequestPathGenerator.java:84) W/System.err? at com.amazon.clouddrive.internal.CloudDriveMethodOperation.retryCall(CloudDriveMethodOperation.java:88) W/System.err? at com.amazon.clouddrive.internal.AbstractCloudDriveOperation.call(AbstractCloudDriveOperation.java:112) W/System.err? at com.amazon.clouddrive.AmazonCloudDriveClient.listNodes(AmazonCloudDriveClient.java:149) Message was edited by: lotussea
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ross@Amazon avatar image
Ross@Amazon answered
Thanks for your reply but some additional info is required. It appears that you are creating an array and then making a request. There is a bit of configuration missing in between that should help answer the question. The log output knows the app_id and the list of scopes, but the code sample never shows them being given as parameters to anything.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lotussea avatar image
lotussea answered
Hi Ross ~! I'm asking information under review. public static final String[] APP_CLOUD_SCOPES = { "profile", "clouddrive:read_all", "clouddrive:write" }; public static synchronized AmazonCloudDriveClient getAmazonCloudDriveClientInstance(Context context) { if ( sAmazonCloudDriveClient == null ) { sAmazonCloudDriveClient = new AmazonCloudDriveClient( new AccountConfiguration( new AmazonAuthorizationConnectionFactory( getAmazonAuthorizationManagerInstance(context), ACDConstants.APP_CLOUD_SCOPES)), new ClientConfiguration(ACDConstants.USER_AGENT)); } return sAmazonCloudDriveClient; } public int getFileList(final String path, final ArrayList fileList) { mAmazonCloudDriveClient = UserState.getAmazonCloudDriveClientInstance(context); ListNodesRequest listNodesRequest = new ListNodesRequest(); if ( path.equals("/") ) { listNodesRequest.setFilters("isRoot:true"); } try { ListNodesResponse listNodesResponse = mAmazonCloudDriveClient.listNodes(listNodesRequest); List nodes = listNodesResponse.getData(); FileInfoParcel fileInfoParcel; for (Node node : nodes) { FileInfo fileInfo = new FileInfo(); fileInfoParcel = new FileInfoParcel(); fileInfo.id = node.getId(); fileInfo.isFolder = node.getKind().equals(NodeKind.FOLDER) ? true : false; fileInfo.parentPath = path; fileInfo.name = node.getName(); fileInfo.size = node.getContentProperties().getSize(); fileInfo.updateTime = getTimeInMillis(node.getModifiedDate()); fileInfoParcel.setFileInfo(fileInfo); fileList.add(fileInfoParcel); } } catch (CloudDriveException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } }
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

lotussea avatar image
lotussea answered
Thanks for your reply and I am wondering if I can get additional answers as soon as possible.. (I am quite urgent...T_T) Thanks :)
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ross@Amazon avatar image
Ross@Amazon answered
From this code snippet we cannot tell if you are setting up the clientId and clientSecret correctly. Before making the call to CDS, the SDK needs to call LWA to fetch the token. It is possible that the call to LWA is failing and no token is being returned.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.