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

Auth errorTypeError: Failed to fetch #1

Open
LukasKriesch opened this issue Jul 19, 2022 · 3 comments
Open

Auth errorTypeError: Failed to fetch #1

LukasKriesch opened this issue Jul 19, 2022 · 3 comments

Comments

@LukasKriesch
Copy link

Hi,
Im trying to get an API-Token for Studiensuche API. I went to https://studiensuche.api.bund.dev/ clicked "authorise" entered the Client ID and Client Secret. I thought I would receive a Token, but I just get the Error Message: "Auth errorTypeError: Failed to fetch".

Am I missing out something?

@AndreasFischer1985
Copy link
Member

AndreasFischer1985 commented Jul 25, 2022

No, you're right - this is supposed to work.

I guess the authorization process currently speficied in the openapi.yaml does not seem to match the process required by https://rest.arbeitsagentur.de/oauth/gettoken_cc (i.e., sending a POST-request with client_id, client_secret and grant_type in the body to get the token that is to be included as OAuthAccessToken in the header of the GET-requests following).

@AndreasFischer1985
Copy link
Member

After a short network analysis of the authorization process at https://studiensuche.api.bund.dev/ it seems like a cross-origin request issue (the CORS-header 'Access-Control-Allow-Origin' is missing, cf. https://developer.mozilla.org/de/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin).

@LukasKriesch
Copy link
Author

Thanks! I was also able to get a token via a POST-request in python.

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

2 participants