嗨,我正在我的应用程序中使用 facebook 登录功能。现在的问题是,当我从 facebook 帐户登录时,我被重定向到带有访问令牌的指定重定向 url。我需要在托管 bean 中获取此访问令牌。我的重定向网址是这样的:localhost:8080/XXXXXX/myholiday.xhtml#access_token=AAAGHUgDJZCg0BAG2I8o
我试过了:
HttpServletRequest request = (HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest();
String url = request.getRequestURL().toString();
System.out.println(url);
System.out.println( FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("access_token"));
// Getting request information without the hostname.
String uri = request.getRequestURI();
System.out.println(uri);
输出如下: localhost:8080/xxxxxxx/myholiday.xhtml
空值
xxxxxxx/myholiday.xhtml
谁能帮我获取访问令牌?