Skip to content

pass phrase prompting when using ConfigFileAuthenticationDetailsProvider #309

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

Open
roeycohen opened this issue Aug 4, 2024 · 3 comments
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@roeycohen
Copy link

Hi.

When using ConfigFileAuthenticationDetailsProvider, is it possible to pass the passphrase from the user's input?

from the code it seems the passphrase should be set in the config file...

const passPhrase = file.get("pass_phrase");

but that would be less secure comparing to the user is typing it in the prompt when possible.

Thanks!

@jyotisaini jyotisaini added the SDK Issue pertains to the SDK itself and not specific to any service label Aug 5, 2024
@jyotisaini
Copy link
Contributor

Hi @roeycohen I don't think there is a prompt to ask passphrase while running the program.

@roeycohen
Copy link
Author

roeycohen commented Aug 6, 2024

hi @jyotisaini indeed there isn't.
But I'd like to type the passphrase myself and pass it to the ConfigFileAuthenticationDetailsProvider...

@talmeme
Copy link

talmeme commented May 12, 2025

Do it in two steps. Here's my Bun snippet using Zenity to input the passphrase:

const fileprovider: oci.ConfigFileAuthenticationDetailsProvider = new oci.ConfigFileAuthenticationDetailsProvider();
 
const cmd = ["/bin/zenity", "--entry", "--width", "300", "--title", "OCI", "--text", "Private key passphrase", "--hide-text"]
const cmdproc = Bun.spawn(cmd)
const keypassphrase = (await Bun.readableStreamToText(cmdproc.stdout)).trim()

const simpleprovider: oci.SimpleAuthenticationDetailsProvider = new oci.SimpleAuthenticationDetailsProvider(
    fileprovider.getTenantId(),
    fileprovider.getUser(),
    fileprovider.getFingerprint(),
    fileprovider.getPrivateKey(),
    keypassphrase,
    fileprovider.getRegion()
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

3 participants