Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud IoT: device registry code on an Android device #1066

Closed
rafaelsf80 opened this issue Mar 20, 2018 · 1 comment
Closed

Cloud IoT: device registry code on an Android device #1066

rafaelsf80 opened this issue Mar 20, 2018 · 1 comment
Assignees

Comments

@rafaelsf80
Copy link

rafaelsf80 commented Mar 20, 2018

Hi,

I'm having some authentication issues when trying to execute some code of Cloud IoT examples on an Android device:

For example, this is the code as available on DeviceRegistryExample.java:

        GoogleCredential credential = GoogleCredential.getApplicationDefault().createScoped(CloudIotScopes.all());
        
        JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
        HttpRequestInitializer init = new RetryHttpInitializerWrapper(credential);
        
        CloudIot service = new CloudIot.Builder(GoogleNetHttpTransport.newTrustedTransport(),jsonFactory, init).setApplicationName(APP_NAME).build();

Since Default Credentials are only valid within App Engine or Compute Engine, I am using a service account for Android instead. The code now looks like this:

        AssetManager am = Main.mContext.getAssets();
        InputStream isCredentialsFile = am.open(CREDENTIALS_FILE_SERVICE_ACCOUNT_PUBSUB_AND_IOT);
        GoogleCredential credential = GoogleCredential.fromStream(isCredentialsFile).createScoped(CloudIotScopes.all());

        JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
        HttpRequestInitializer init = new RetryHttpInitializerWrapper(credential);

        CloudIot service = new CloudIot.Builder(GoogleNetHttpTransport.newTrustedTransport(), jsonFactory, init).setApplicationName(TAG).build();

I'm having the following runtime JKS not found exception (JKS keystore not available) on CloudIot.Builder line. Any suggestions would be appreciated.

Thanks,
Rafa

03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: java.security.KeyStoreException: JKS not found
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at java.security.KeyStore.getInstance(KeyStore.java:890)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at com.google.api.client.util.SecurityUtils.getJavaKeyStore(SecurityUtils.java:53)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at com.google.api.client.googleapis.GoogleUtils.getCertificateTrustStore(GoogleUtils.java:74)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at com.google.api.client.googleapis.javanet.GoogleNetHttpTransport.newTrustedTransport(GoogleNetHttpTransport.java:55)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at com.google.cloud.iberia.IoTCoreRegisterService.onHandleIntent(IoTCoreRegisterService.java:80)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:76)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at android.os.Handler.dispatchMessage(Handler.java:106)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at android.os.Looper.loop(Looper.java:164)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at android.os.HandlerThread.run(HandlerThread.java:65)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: Caused by: java.security.NoSuchAlgorithmException: JKS KeyStore not available
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at sun.security.jca.GetInstance.getInstance(GetInstance.java:159)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at java.security.Security.getImpl(Security.java:627)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: at java.security.KeyStore.getInstance(KeyStore.java:887)
03-20 15:35:26.401 29410-29519/com.google.cloud.iberia I/System.out: ... 8 more

@kurtisvg
Copy link
Contributor

Notice: this issue has been closed because it has been inactive for 192 days. You may reopen this issue if it has been closed in error.

Shabirmean pushed a commit that referenced this issue Nov 17, 2022
…1066)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-core](https://togithub.com/googleapis/java-core) | `2.8.8` -> `2.8.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/compatibility-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/confidence-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-core</summary>

### [`v2.8.9`](https://togithub.com/googleapis/java-core/blob/HEAD/CHANGELOG.md#&#8203;289-httpsgithubcomgoogleapisjava-corecomparev288v289-2022-08-16)

[Compare Source](https://togithub.com/googleapis/java-core/compare/v2.8.8...v2.8.9)

##### Dependencies

-   update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#&#8203;900](https://togithub.com/googleapis/java-core/issues/900)) ([c01b47a](https://togithub.com/googleapis/java-core/commit/c01b47a122a9036f8c594cb583dab3512a257597))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#&#8203;901](https://togithub.com/googleapis/java-core/issues/901)) ([13e2fd6](https://togithub.com/googleapis/java-core/commit/13e2fd6fbae1d34385ec500aaf4a2b38e19dd6de))
-   update dependency org.threeten:threetenbp to v1.6.1 ([#&#8203;902](https://togithub.com/googleapis/java-core/issues/902)) ([02dac62](https://togithub.com/googleapis/java-core/commit/02dac62784a6614291836917b022a32745312157))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-translate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjEuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE2MS4wIn0=-->
Shabirmean pushed a commit that referenced this issue Nov 18, 2022
…1066)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-core](https://togithub.com/googleapis/java-core) | `2.8.8` -> `2.8.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/compatibility-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/confidence-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-core</summary>

### [`v2.8.9`](https://togithub.com/googleapis/java-core/blob/HEAD/CHANGELOG.md#&#8203;289-httpsgithubcomgoogleapisjava-corecomparev288v289-2022-08-16)

[Compare Source](https://togithub.com/googleapis/java-core/compare/v2.8.8...v2.8.9)

##### Dependencies

-   update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#&#8203;900](https://togithub.com/googleapis/java-core/issues/900)) ([c01b47a](https://togithub.com/googleapis/java-core/commit/c01b47a122a9036f8c594cb583dab3512a257597))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#&#8203;901](https://togithub.com/googleapis/java-core/issues/901)) ([13e2fd6](https://togithub.com/googleapis/java-core/commit/13e2fd6fbae1d34385ec500aaf4a2b38e19dd6de))
-   update dependency org.threeten:threetenbp to v1.6.1 ([#&#8203;902](https://togithub.com/googleapis/java-core/issues/902)) ([02dac62](https://togithub.com/googleapis/java-core/commit/02dac62784a6614291836917b022a32745312157))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-translate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjEuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE2MS4wIn0=-->
Shabirmean pushed a commit that referenced this issue Nov 18, 2022
…1066)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-core](https://togithub.com/googleapis/java-core) | `2.8.8` -> `2.8.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/compatibility-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/confidence-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-core</summary>

### [`v2.8.9`](https://togithub.com/googleapis/java-core/blob/HEAD/CHANGELOG.md#&#8203;289-httpsgithubcomgoogleapisjava-corecomparev288v289-2022-08-16)

[Compare Source](https://togithub.com/googleapis/java-core/compare/v2.8.8...v2.8.9)

##### Dependencies

-   update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#&#8203;900](https://togithub.com/googleapis/java-core/issues/900)) ([c01b47a](https://togithub.com/googleapis/java-core/commit/c01b47a122a9036f8c594cb583dab3512a257597))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#&#8203;901](https://togithub.com/googleapis/java-core/issues/901)) ([13e2fd6](https://togithub.com/googleapis/java-core/commit/13e2fd6fbae1d34385ec500aaf4a2b38e19dd6de))
-   update dependency org.threeten:threetenbp to v1.6.1 ([#&#8203;902](https://togithub.com/googleapis/java-core/issues/902)) ([02dac62](https://togithub.com/googleapis/java-core/commit/02dac62784a6614291836917b022a32745312157))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-translate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjEuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE2MS4wIn0=-->
anguillanneuf pushed a commit that referenced this issue Dec 5, 2022
…1066)

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [com.google.cloud:google-cloud-core](https://togithub.com/googleapis/java-core) | `2.8.8` -> `2.8.9` | [![age](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/compatibility-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/maven/com.google.cloud:google-cloud-core/2.8.9/confidence-slim/2.8.8)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>googleapis/java-core</summary>

### [`v2.8.9`](https://togithub.com/googleapis/java-core/blob/HEAD/CHANGELOG.md#&#8203;289-httpsgithubcomgoogleapisjava-corecomparev288v289-2022-08-16)

[Compare Source](https://togithub.com/googleapis/java-core/compare/v2.8.8...v2.8.9)

##### Dependencies

-   update dependency com.google.auth:google-auth-library-bom to v1.10.0 ([#&#8203;900](https://togithub.com/googleapis/java-core/issues/900)) ([c01b47a](https://togithub.com/googleapis/java-core/commit/c01b47a122a9036f8c594cb583dab3512a257597))
-   update dependency com.google.protobuf:protobuf-bom to v3.21.5 ([#&#8203;901](https://togithub.com/googleapis/java-core/issues/901)) ([13e2fd6](https://togithub.com/googleapis/java-core/commit/13e2fd6fbae1d34385ec500aaf4a2b38e19dd6de))
-   update dependency org.threeten:threetenbp to v1.6.1 ([#&#8203;902](https://togithub.com/googleapis/java-core/issues/902)) ([02dac62](https://togithub.com/googleapis/java-core/commit/02dac62784a6614291836917b022a32745312157))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/java-translate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xNjEuMCIsInVwZGF0ZWRJblZlciI6IjMyLjE2MS4wIn0=-->
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

No branches or pull requests

3 participants