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

403 Forbidden with API token #123

Open
rhythmize opened this issue Sep 5, 2019 · 34 comments
Open

403 Forbidden with API token #123

rhythmize opened this issue Sep 5, 2019 · 34 comments

Comments

@rhythmize
Copy link

rhythmize commented Sep 5, 2019

@korshaknn , As suggested by you. I'm trying to build the examples for this repo.
Following is the build output.

Could not GET 'https://api.mapbox.com/downloads/v1/vision/android/maven/com/mapbox/vision/mapbox-android-vision/0.8.0/mapbox-android-vision-0.8.0.pom'. Received status code 403 from server: Forbidden
Enable Gradle 'offline mode' and sync project

I'm using a freshly generated token.

Please suggest.

@korshaknn
Copy link
Contributor

@Code-Player have you added the token to gradle? Use gradle.properties file or add directly to
credentials {
username project.properties['mapboxMavenUser'] ?: ""
password project.properties['mapboxMavenToken'] ?: ""
}

@rhythmize
Copy link
Author

rhythmize commented Sep 5, 2019

I added token in developer-config file. And Updated in gradle scripts too.

username project.properties['mapboxMavenUser'] ?: "rhythm-tonbo"
password project.properties['mapboxMavenToken'] ?: "<my-token-here>"

I tried with mapbox as username as well.
Nothing works.

@yunikkk
Copy link
Collaborator

yunikkk commented Sep 5, 2019

@Code-Player hi,
have you checked the docs https://vision.mapbox.com/install/ here?
Auth should look like

maven {
  url 'https://api.mapbox.com/downloads/v1/vision/android/maven'
  authentication {
    basic(BasicAuthentication)
  }
  credentials {
    username = 'mapbox'
    password = 'ADD-YOUR-TOKEN'
  }
}

according to it

@rhythmize
Copy link
Author

rhythmize commented Sep 5, 2019

Its exactly the same. Still I get 403 Forbidden.

maven {
            url 'https://api.mapbox.com/downloads/v1/vision/android/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                username = "mapbox"
                password = "my-token-here"
            }
        }

@rhythmize
Copy link
Author

Looks like it's unable to authenticate my token.

@yunikkk
Copy link
Collaborator

yunikkk commented Sep 5, 2019

@Code-Player does your token contain vision:download scope? It's necessary to be able to download Vision libraries. Please check Import Vision into your project with a package manager (Recommended) section at https://vision.mapbox.com/install/

@rhythmize
Copy link
Author

rhythmize commented Sep 5, 2019

Yeah, created a new token with said scope. But now, following is the error.

Crashlytics found an invalid API key: null. 
Check the Crashlytics plugin to make sure that the application has been added successfully! 
Contact [email protected] for assistance.

@yunikkk
Copy link
Collaborator

yunikkk commented Sep 5, 2019

Ah, this is the issue #43, there is temporary solution described there

@rhythmize
Copy link
Author

Which token am I supposed to provide there? Can I use the one I got from mapbox? It responds as invalid token if I user mapbox token

@rhythmize
Copy link
Author

Alright, got it working now. !!
But the error log still persists.

2019-09-05 12:43:14.681 27652-27737/com.mapbox.vision.teaser.debug E/linker: library "/vendor/lib64/libOpenCL.so" ("/system/vendor/lib64/libOpenCL.so") needed or dlopened by "/data/app/com.mapbox.vision.teaser.debug-NGn3S_pVAhhHnYjbtFPdYg==/lib/arm64/libSNPE.so" is not accessible for the namespace: [name="classloader-namespace", ld_library_paths="", default_library_paths="/data/app/com.mapbox.vision.teaser.debug-NGn3S_pVAhhHnYjbtFPdYg==/lib/arm64:/data/app/com.mapbox.vision.teaser.debug-NGn3S_pVAhhHnYjbtFPdYg==/base.apk!/lib/arm64-v8a", permitted_paths="/data:/mnt/expand:/data/data/com.mapbox.vision.teaser.debug"]

Please suggest.

@rhythmize
Copy link
Author

@yunikkk, even in the demo app, I don't see any overlay/ icon in the app. All I get is simple camera feed, for example, lane detection does not show any overlay highlighting the lane/ direction.

Please suggest.

@kiryldz
Copy link
Contributor

kiryldz commented Feb 20, 2020

@rhythmize - what device are you using for testing?

@yunikkk
Copy link
Collaborator

yunikkk commented May 27, 2020

Closing dut to inactivity, feel free to reopen.

@yunikkk yunikkk closed this as completed May 27, 2020
@Charfedine
Copy link

hey @rhythmize
if you please provide the solution that worked for you, because i tried like you and still the same error

@yunikkk
Copy link
Collaborator

yunikkk commented Apr 20, 2021

@Charfedine which error exactly do you have?

@Charfedine
Copy link

@yunikkk when i wrote the comment it was 403 Forbidden with API, which i managed to fix by changing the username to mapbox and check the DOWNLOADS:READ secret scope.

But now i get this : - "Failed to resolve: com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0"
- "Failed to resolve: com.mapbox.navigation:ui:1.5.1"

@yunikkk
Copy link
Collaborator

yunikkk commented Apr 21, 2021

Do you try to build this repo? We don't have com.mapbox.navigation:ui:1.5.1 in the dependencies here, maybe you've modified gradle configs somehow?

@yunikkk yunikkk reopened this Apr 21, 2021
@Charfedine
Copy link

Yes I tried to build it but keep getting "Caused by: org.gradle.api.InvalidUserDataException: You haven't set MAPBOX_ACCESS_TOKEN." despite the fact that i set it as a env variable ! That's what led me to the other error when i tried to adapte mapbox to a new project

@Charfedine
Copy link

"Received status code 403 from server: Forbidden" is back !

@splasky
Copy link

splasky commented May 10, 2021

Hi @Charfedine. I had met the same problem. Did you solve yet?

@Charfedine
Copy link

@splasky no i didn't sorry

@bacarPereira
Copy link

@splasky create a new token here and then check the option DOWLOADS: READS

mapBox

@splasky
Copy link

splasky commented May 15, 2021

@splasky create a new token here and then check the option DOWLOADS: READS

mapBox

OK, It works. Thanks!

@OlavAa
Copy link

OlavAa commented May 21, 2021

I have the same problem yesterday and today. I was eventually successful yesterday using the:
com.mapbox.maps:android:10.0.0-beta.19

Eventually (after trying a lot of times and in frustration pasting in the key directly into the project build.gradle). I think it is a general problem, because when I now try with another Android project the problem is back. Tried to make a new key, tried to use a different Mapbox account, tried to use the gradle.properties and pasting password directly in. But I do not get passed the build:
Unable to resolve dependency for ':Android@dhpilotDebug/compileClasspath': Could not resolve com.mapbox.maps:android:10.0.0-beta.20. Show Details Affected Modules: Android

and
`FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':Android:compileDhpilotDebugJavaWithJavac'.

Could not resolve all task dependencies for configuration ':Android:dhpilotDebugCompileClasspath'.
Could not resolve com.mapbox.maps:android:10.0.0-beta.20.
Required by:
project :Android
> Could not resolve com.mapbox.maps:android:10.0.0-beta.20.
> Could not get resource 'https://dl.bintray.com/3d-robotics/maven/com/mapbox/maps/android/10.0.0-beta.20/android-10.0.0-beta.20.pom'.
> Could not GET 'https://dl.bintray.com/3d-robotics/maven/com/mapbox/maps/android/10.0.0-beta.20/android-10.0.0-beta.20.pom'. Received status code 403 from server: Forbidden
`

@yunikkk
Copy link
Collaborator

yunikkk commented Jun 3, 2021

We've updated the docs that should fix all the issues with tokens, please take a look https://docs.mapbox.com/android/vision/guides/install/

@sabramooz
Copy link

You must use this documentation to resolve this problem:
https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md

@yunikkk
Copy link
Collaborator

yunikkk commented Jul 27, 2021

You must use this documentation to resolve this problem:
https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md

@sabramooz not sure why this specific doc from react-native repo was mentioned. We now have correct documentation about updated maven configuration at https://docs.mapbox.com/android/vision/guides/install/

@sabramooz
Copy link

You must use this documentation to resolve this problem:
https://github.com/react-native-mapbox-gl/maps/blob/master/android/install.md

@sabramooz not sure why this specific doc from react-native repo was mentioned. We now have correct documentation about updated maven configuration at https://docs.mapbox.com/android/vision/guides/install/

Thanks, this works too.

@teju
Copy link

teju commented Aug 27, 2021

here

i'm unable to see secret scope list. please help

@amirahmadadibi
Copy link

this is most annouing and undervalued shit problem that you have, fix it like real person or team or what ever.
you are not doing it right.
error is still hanging
mapbox-android-sdk-9.6.1.pom'. Received status code 403 from server: Request blocked by Privoxy

@vitali-itechart
Copy link

vitali-itechart commented Apr 21, 2023

I followed all the instructions described and nothing helped, same project works for the rest of the team but I'm still getting 403. Is there a workaround for that or something? Maybe I can download it manually or kind of get from a repo that doesn't keep a goddam SDK under a password like it's usually done?

@seprinta
Copy link

i also have same case in my website, which has tracking user current location fiture , but i using free access token , so i look for information why it forbidden 403 , i just want to make sure that i should create new account to get new access token for the tilequery map API then the map will works with the new access token , or probably any better solutions for this case ?

@LuixDev
Copy link

LuixDev commented May 25, 2024

ya no funciona mapbox_gl quedo absoleto le recomiendo que use otra libreria

@isaaclacoba
Copy link

@Code-Player does your token contain vision:download scope? It's necessary to be able to download Vision libraries. Please check Import Vision into your project with a package manager (Recommended) section at https://vision.mapbox.com/install/

For future victims of this bullshit, while generating the token, remember to add the permissions required to download.

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