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

How to pass settings to NewClientWithPassword()? #501

Open
coolcoolnoworries opened this issue Apr 2, 2024 · 2 comments
Open

How to pass settings to NewClientWithPassword()? #501

coolcoolnoworries opened this issue Apr 2, 2024 · 2 comments

Comments

@coolcoolnoworries
Copy link

Attempting to disable FAST via client.DisablePAFXFAST(true), as shown here https://github.com/jcmturner/gokrb5/blob/master/USAGE.md, but nothing seems to work when passing it as an argument.

Tried:
gssapi.Settings.DisablePAFXFAST(true)
client.Settings.DisablePAFXFAST(true)
client.DisablePAFXFAST(true)
gssapi.DisablePAFXFAST(true)
DisablePAFXFAST(true)

All error out as undefined.

The function declaration does seem designed to handle settings args, but its not clear how.

func NewClientWithPassword(username, realm, password string, krb5confPath string, settings ...func(*client.Settings)) (*Client, error) {

Anyone have any insight?

@randomvariable
Copy link

github.com/jcmturner/gokrb5/v8/client client.DisablePAFXFAST(true) should work

@p0dalirius
Copy link

Hey @coolcoolnoworries

You can use it like this:

c, err := client.NewClientWithPassword(
    username,
    realm,
    password,
    krb5confPath,
    client.DisablePAFXFAST(true),
)

Also, If you are trying to authenticate with Kerberos, can you take a look at this issue? #536, Were you able to make a working code with Kerberos auth?

Best regards,

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

3 participants