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

Unclear how to get refresh token / force URL #10

Open
fransf-wtax opened this issue Sep 23, 2021 · 5 comments
Open

Unclear how to get refresh token / force URL #10

fransf-wtax opened this issue Sep 23, 2021 · 5 comments

Comments

@fransf-wtax
Copy link

The README says:

You can obtain the URL from a authorized org from your local machine using: sfdx force:org:display -u ORG-ALIAS --verbose

However, running this command on my prod org gives the following output:

{
  "username": "admin@********",
  "accessToken": "d47b6dbd7f****************************************:8f49********",
  "orgId": "00D***************",
  "loginUrl": "https://login.salesforce.com/",
  "privateKey": "******************",
  "clientId": "3H7c**************************",
  "instanceUrl": "https://****.my.salesforce.com",
  "instanceApiVersion": "52.0",
  "instanceApiVersionLastRetrieved": "9/23/2021, 10:22:37 AM"
}

I don't see any URL containing a refresh token, or the refresh token itself. Perhaps the README instructions are outdated?

@BrunoMendes-Hotmart
Copy link

BrunoMendes-Hotmart commented Jan 27, 2022

Hi, how are you?
Do you solve the problem?
I have the same problem.

@baksale
Copy link

baksale commented Mar 12, 2022

Hi @BrunoMendes-Hotmart @fransf-wtax ,
Have you authenticated your orgs using jwt flow?

If this is the case, the sfdx force:org:display command will not show auth url.

sfdx force:auth:sfdxurl:store -h | grep "only for orgs authorized with the web server flow" -A 2

You have to re-authenticate your orgs using web flow:
sfdx force:auth:web:login -h

If this is the case, please comment and close the issue.

@Julian88Tex
Copy link

@baksale Not sure about @fransf-wtax's use case, but I'd definitely appreciate being able to get a refresh token without having to go through a JWT or web login flow.

@baksale
Copy link

baksale commented Mar 22, 2022

@Julian88Tex with auth url for your org you will not need to refresh any tokens - the action will just work.

Below operations needs to be done for THE_ORG just once:

  1. Authorize THE_ORG via web flow
  2. get the auth url once for your org via sfdx force:org:display -u THE_ORG --verbose --json
  3. Use the auth url for the action

It will work THE_ORG going further.

The issue guys mentioned earlier most likely due to THE_ORG was authorized via jwt flow.

@Julian88Tex
Copy link

@baksale thanks yes I realize that however I am actually trying to obtain a refresh token so that I can use it as an authentication method for some CI/CD processes

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

4 participants