31
Views
6
Comments
Solved
[Google Cloud Vision OCR] Error [403] occurs when using GoogleCloudVisionOCR on Android
googlecloudvisionocr
Service icon
Forge asset by Aurelio Junior
Application Type
Mobile
Service Studio Version
11.54.13 (Build 62526)

Hi all,

I want to take a pic and send it GoogleCloudVision so get the GoogleCloudVisionOCR from Forge and use.

But when I set API restrictions 'Android apps' and set API restrict key, an Error message as attached pic displayed and Googe API kicks request out.

When I set none restriction, it works well.

How do I deal with this situation?

Thanks in advance.

2018-08-04 18-19-00
André Pinho
Solution

Hi Tomio, 

I agree with Stefan the server hosting outsystems is making these requests not the app. 
Here are 2 restrictions I think you could try and apply
1 - Restrict Ip address of your front end server. 
I am not 100% sure if using the domains will work as Stefan suggested, but try using the websites options. 
I would try the ip address using the front end server ip (if using outsystems cloud)

2 - Restrict the APIs that can be used with that key
Cloud Vision APIs rather than other APIs (like Google Maps) etc that way you are minimising the exposure of that key.

2023-06-29 09-44-22
Tomio Kawakai

Thanks André for detailed reply and suggests.

As I wrote in reply to Stefan, I restrict by IP and my app works as planned.

Then I think "If IP Address of Outsystems frontend server change?" 

So I'm thinking the fundamental solution would be modify the GCVOCR Runtime to send App identifier or something like that Google API needs.

Anyway, the problem solved for the time being. Thanks for help and sorry for my poor English.

2018-08-04 18-19-00
André Pinho

Ip address on the front end server(s), if using OutSystems cloud, is static

2023-06-29 09-44-22
Tomio Kawakai

Thanks André. Your info eases me. Sorry for the late reply.

And my boss maintained the GCVOCR library add a magic to send App info and this and that.

Again many many thanks to your assist and concern.

Sincerely.

2021-10-09 07-57-44
Stefan Weber
 
MVP
Solution

The Google Connector you are using is running on the OutSystems Frontend Server. Your mobile app is not the origin of the request, thus not the requesting application. Your app calls your frontend server that calls Google API. You can restrict to http origins instead referring to your OutSystems environment URLs.

2023-06-29 09-44-22
Tomio Kawakai

Thank you Stefan, I understand how it doesn't work.

I can't find out URLs so restrict by IP and it works.

Thanks for the answer. You've been very helpful.

2018-08-04 18-19-00
André Pinho
Solution

Hi Tomio, 

I agree with Stefan the server hosting outsystems is making these requests not the app. 
Here are 2 restrictions I think you could try and apply
1 - Restrict Ip address of your front end server. 
I am not 100% sure if using the domains will work as Stefan suggested, but try using the websites options. 
I would try the ip address using the front end server ip (if using outsystems cloud)

2 - Restrict the APIs that can be used with that key
Cloud Vision APIs rather than other APIs (like Google Maps) etc that way you are minimising the exposure of that key.

2023-06-29 09-44-22
Tomio Kawakai

Thanks André for detailed reply and suggests.

As I wrote in reply to Stefan, I restrict by IP and my app works as planned.

Then I think "If IP Address of Outsystems frontend server change?" 

So I'm thinking the fundamental solution would be modify the GCVOCR Runtime to send App identifier or something like that Google API needs.

Anyway, the problem solved for the time being. Thanks for help and sorry for my poor English.

2018-08-04 18-19-00
André Pinho

Ip address on the front end server(s), if using OutSystems cloud, is static

2023-06-29 09-44-22
Tomio Kawakai

Thanks André. Your info eases me. Sorry for the late reply.

And my boss maintained the GCVOCR library add a magic to send App info and this and that.

Again many many thanks to your assist and concern.

Sincerely.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.