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

use this lib with an external provided token. #89

Open
demoze opened this issue May 3, 2017 · 2 comments
Open

use this lib with an external provided token. #89

demoze opened this issue May 3, 2017 · 2 comments
Labels

Comments

@demoze
Copy link

demoze commented May 3, 2017

Hello,

Thank for your work. I've setup an openstack swift with keystone identity and kerberos. My usual workflow to access swift is an 3 step process.

  1. call our identity service to get an access_token
  2. call keystone with the access_token, to get a auth_token and storage_url
  3. call swift api with the auth_token and storage_url

Using the lib, I just have to do step 1 and 2 and then provide AuthToken, StorageUrl and bypass authenticate call to get a working example.
It works fine

Is this intentional, or is it working by accident ?
I've done some small update to rclone to get it working too.

working example.

       package main

       import (
          "fmt"

          "github.com/ncw/swift"
       )

func main() {


        auth_token  := "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
        storage_url := "https://api.example.net/v1/AUTH_project1"


        c := &swift.Connection{
                AuthVersion: 0,
                AuthToken:   auth_token,
                StorageUrl:  storage_url,
        }

        // Authenticate  XXX
        //err := c.Authenticate()
        //if err != nil {
        //        panic(err)
        //}

        info, headers, err := c.Account()
        if err != nil {
              panic(err)
        }

        fmt.Println(info)
        fmt.Println(headers)
}
     
@demoze
Copy link
Author

demoze commented May 3, 2017

ok, it seems to be a duplicate if #80

@ncw
Copy link
Owner

ncw commented Jul 23, 2017

Is this intentional, or is it working by accident ?

No that is how it is supposed to work.

There may be trouble when the token expires, but there isn't any way around that.

@ncw ncw added the question label Jul 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants