我正在使用Spring OAuth 2保护我的REST API。在那里,我有许多客户端,每个客户端都有用户。例如;客户A具有用户A1和A2,客户B具有用户B1和B2。但我找不到定义客户端和用户之间关系的方法。 (A1属于A,不属于B等)。我正在使用内存中的用户详细信息服务,如下所示,
import java.net.*;
import java.io.*;
import org.apache.http.*;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpUriRequest;
public class DownloadDDFromGit {
public void Download(String url) throws IOException
{
URL u;
InputStream is = null;
DataInputStream dis;
String s;
HttpGet httpget = new HttpGet(url);
u = new URL(url);
is = u.openStream();
dis = new DataInputStream(new BufferedInputStream(is));
OutputStream out= null;
File file = new File("D:/Local.xlsx");
//OutputStreamWriter outputStreamWriter = new OutputStreamWriter(out, "UTF-8");
OutputStream outStream = new FileOutputStream(file);
byte[] buffer = new byte[8 * 1024];
int bytesRead;
while ((bytesRead = dis.read(buffer)) != -1 )
{
outStream.write(buffer, 0, bytesRead);
}
}
public static void main(String[] args) throws IOException {
String url = "https://git.ap.person123.com/projects/BDP/repos/atlas_script/browse/tagsAutomation/test_atlas_tags_automation.xlsx?at=refs%2Fheads%2FDEVO-108&raw";
DownloadDDFromGit dwld = new DownloadDDFromGit();
dwld.Download(url);
}
}
和自定义客户端详细信息服务。有没有办法定义哪些用户属于哪个客户端?