Aiven-Open / Aiven-Open/salesforce-connector-for-apache-kafka
Get `instance_url` from OAuth login
- Dominant language
- Java
- Stars
- 1
- Forks
- 3
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 5
Description
# What is currently missing?
We use the OAuth login flow [fetches the `access_token`](https://github.com/Aiven-Open/salesforce-connector-for-apache-kafka/blob/60d379fc2c0bb69d36363b199cca76eade53557e/common/src/main/java/io/aiven/kafka/connect/salesforce/common/auth/credentials/Oauth2Login.java#L75) credentials, and the response looks like:
```
{ "access_token":"MY-SECRET-TOKEN-FOR-API-CALLS",
"signature":"SIG-STUFF",
"scope":"api",
"instance_url":"https://orgfarm-EXAMPLE-dev-ed.develop.my.salesforce.com",
"id":"https://login.salesforce.com/id/SOME/ID",
"token_type":"Bearer",
"issued_at":"ETC"}
```
# How could this be improved?
If the `salesforce.uri` in the connector configuration isn't specified, we fall back to the `instance_url` from here.
# Is this a feature you would work on yourself?
* [ ] I plan to open a pull request for this feature
Contributor guide
Research direction
Start in common/src/main/java/io/aiven/kafka/connect/salesforce/common/auth/credentials/Oauth2Login.java at the OAuth access-token handling around line 75, then trace how the salesforce.uri configuration is read. Done means the connector uses the OAuth response's instance_url when salesforce.uri is not specified, while preserving an explicitly configured URI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- authentication, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100