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 can I authorize? #167

Open
MJ-Youn opened this issue Nov 7, 2018 · 1 comment
Open

How can I authorize? #167

MJ-Youn opened this issue Nov 7, 2018 · 1 comment

Comments

@MJ-Youn
Copy link

MJ-Youn commented Nov 7, 2018

Hi, i use jglobus in my pc.

package kr.co.ymtech;

import java.io.IOException;
import java.util.Vector;

import org.globus.ftp.GridFTPClient;
import org.globus.ftp.exception.ClientException;
import org.globus.ftp.exception.ServerException;

public class Main {
	
	public static String message;
	
	public static void main(String[] args) {
		
		try {
			GridFTPClient gridFTPClient = new GridFTPClient("192.168.56.123", 2811);
			
			Vector<?> vector = gridFTPClient.list();
			System.out.println(vector);
		} catch (ServerException | IOException | ClientException e) {
			e.printStackTrace();
		}
	}
	
}

Error

org.globus.ftp.exception.ClientException: Server authorization has not been performed. Custom message: Need to perform authorization first (error code 1)
	at org.globus.ftp.Session.compareTransferParams(Session.java:116)
	at org.globus.ftp.GridFTPSession.matches(GridFTPSession.java:106)
	at org.globus.ftp.GridFTPClient.checkTransferParamsGet(GridFTPClient.java:173)
	at org.globus.ftp.FTPClient.performTransfer(FTPClient.java:751)
	at org.globus.ftp.FTPClient.list(FTPClient.java:516)
	at org.globus.ftp.FTPClient.list(FTPClient.java:450)
	at org.globus.ftp.GridFTPClient.list(GridFTPClient.java:123)
	at org.globus.ftp.FTPClient.list(FTPClient.java:419)
	at org.globus.ftp.FTPClient.list(FTPClient.java:394)
	at kr.co.ymtech.Main.main(Main.java:31)

but i fase this error.
I think, because, this error have not authorization info.
I don't know to run gridftpclient with authorization.
please advice.

@MJ-Youn MJ-Youn changed the title How can I authorizte? How can I authorize? Nov 7, 2018
@paulmillar
Copy link
Contributor

You authenticate using one of the authenticate methods. There are two: one that accepts a GSSCredential argument and uses a default username (:globus-mapping:) while the other accepts the username as an argument.

I suspect that the first version (just the GSSCredential argument) is the one you should use.

The GSSCredential is the X.509 credential that represents the identity you want to use when authenticating. Normally, this is created by the user with the voms-proxy-init, arc-proxy, or similar command and stored as the file /tmp/x509up_u$(id -u).

Alternatively, you could create this proxy credential as part of your application. For normal users that (usually) requires entering in a passphrase (robot certificates, however, don't require this). The proxy credential (normally) requires no such passphrase, so this is usually the preferred way to get a credential.

The ExtendedGSSManager (abstract) class may be used to load the credential as a GSSCredential object. See gridftp/src/main/java/org/globus/ftp/examples/LocalCredentialHelper.java for an example on how to do this.

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

2 participants