Comment on page
Authorization: ApiKey, Credentials or OAuth 2.0
We recommend checking all authorization options. The choice depends on the particular use case. More usage details are described in every option below.
Authorization with “username” and “password” is one of the possible approaches. In this case, email registration must be done (not using social networks).
The approach is recommended for integration on the API (BackEnd) level and all requests to GeoPard API are proxied via a dedicated special service (microservice).
Login request example:
1
curl --location --request POST 'https://api.geopard.tech/login' \
2
--header 'Content-Type: application/json' \
3
--header 'Content-Type: text/plain' \
4
--data-raw '{"username":"<email_address>","password":"<password>"}'
AWS Cognito supports OAuth 2.0 protocol for authorization. The general overview is described in the article Cognito OAuth2 manual, the sub-article Authorization Code Grant is the most interesting in the GeoPard case.
The approach is recommended to integrate GeoPard at the UserInterface (FrontEnd) level. The integration works in both directions to send/receive data to/from GeoPard.
Keeping the story short:
- 1.Your application has to redirect a user to GeoPard Cognito for login or registration.
Example:
1
curl --location --request GET '
2
https://auth.geopard.tech/oauth2/authorize?response_type=code&client_id=<connect_geopard_team>&redirect_uri=http://localhost:8080&state=54321
3
'
Please, connect with the GeoPard team to receive your application individual
client_id
.- 2.The redirected URL will receive a verification
code
for the next step.
The redirected URL looks like
http://localhost:8080/?code=eb10956a-6d51-49e5-bbfe-9815e3fdc70a&state=54321
.- 3.Your application has to exchange
code
fortokens
(access_token
,refresh_token
,id_token
).
Example:
1
curl --location --request POST '
2
https://auth.geopard.tech/oauth2/token
3
' \
4
--header 'Content-Type: application/x-www-form-urlencoded' \
5
--header 'Cookie: XSRF-TOKEN=365e14e1-3c66-477e-b0ef-a9e436a834ee; csrf-state=""; csrf-state-legacy=""' \
6
--data-urlencode 'grant_type=authorization_code' \
7
--data-urlencode 'code=eb10956a-6d51-49e5-bbfe-9815e3fdc70a' \
8
--data-urlencode 'client_id=42ajne9u466in6gaf569nth9o9' \
9
--data-urlencode 'redirect_uri=
10
http://localhost:8080
11
'
Quick access to WMS and WFS is necessary from time to time. Therefore, it is possible to use the GeoPard API key automatically generated for every account.
The API key is located in the "UserData" GraphQL entity in
apiKey
attribute.Must be used with
/geo
endpoints ONLY.Usage:
- 1.As a
geopardApiKey
parameter in the GET request URL. - 2.As an
X-API-Key
header in ANY request.
Last modified 4mo ago