小编Mat*_*his的帖子

Spring OAuth2:无法从 ClientDetailsS​​ervice 获取附加信息

我正在将 OAuth2 与 Spring Security 结合使用。我的身份验证管理器通过数据库配置客户端:clients.jdbc(dataSource());

一切正常,但在请求令牌时,出现异常:

2017-04-28 11:14:39.656  WARN 1200 --- [io-8096-exec-10] o.s.s.o.p.c.JdbcClientDetailsService     : Could not decode JSON for additional information: BaseClientDetails [clientId=myclientid, clientSecret=mysecret, scope=[myscope], resourceIds=[], authorizedGrantTypes=[authorization_code, refresh_token], registeredRedirectUris=null, authorities=[], accessTokenValiditySeconds=36000, refreshTokenValiditySeconds=36000, additionalInformation={}]
Run Code Online (Sandbox Code Playgroud)

有踪迹:

org.codehaus.jackson.JsonParseException: Unexpected character ('a' (code 97)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [Source: java.io.StringReader@557a138f; line: 1, column: 2]
...
...
Run Code Online (Sandbox Code Playgroud)

其中表中的列additional_information( varchar(4096))client_details是该条目的“asdf”。

additional_information我还尝试更改from的类型StringMap<String, Object>并通过使用键“info”将其放入地图中来插入字符串。之后,我得到相同的错误,但跟踪不同:

org.codehaus.jackson.JsonParseException: Unrecognized token …
Run Code Online (Sandbox Code Playgroud)

spring spring-security oauth-2.0 spring-oauth2

5
推荐指数
0
解决办法
2200
查看次数

是否可以在Android Profiler中检查网络请求的后置参数

是否可以检查请求的POST参数?例如,我的URL是https:// [myrestapi] .com/get_puppy_by_name.php,我的参数是"puppyname = rantanplan".

Android Studio Profiler向我展示:

  • 请求
  • 方法
  • 地位
  • 内容类型
  • 尺寸
  • URL

和响应包括标题.此外,还显示了调用堆栈.但是没有我的POST参数的痕迹.如果不可能的话,这将是一个非常方便的功能.

android

5
推荐指数
1
解决办法
784
查看次数

是否有必要验证 SAML 断言

作为服务提供商,我试图通过从身份提供商 (IdP) 获取 SAML 断言 (SAML 1.0) 来验证我页面上的用户。执行以下步骤(非常抽象):

  1. 用户访问我的页面
  2. 我将用户重定向到用户进行身份验证的 IdP
  3. 我得到一个 SAML Artifact,我用它从 IdP 请求 SAML 断言
  4. IdP 将 SAML 断言直接发送回我的页面
  5. ?

这个过程是否足以确保用户身份验证是合法的?我是否只是在步骤 5 中授予用户访问我的服务的权限,还是必须通过验证断言中的签名来确保 SAML 断言有效?如果是这样,我该怎么做?我是否错过了任何其他步骤?

authentication validation saml

4
推荐指数
2
解决办法
4316
查看次数

在PHP中显示来自PostgreSQL数据库的图像

我想在PHP文件中显示PostgreSQL数据库中的图像.在尝试了很多不同的可能性后,我不会走得太远.这是我做的:

上传:

echo "<div>".
    "<table border=\"1\" cellpadding=\"3\">".
       "<form action=\"test2.php\" method=\"post\" enctype=\"multipart/form-data\">".
         "<tr>".
           "<td>".
             "<input type=\"file\" name=\"file\" id=\"file\">".
             "<input class=\"button\" type=\"submit\" name=\"submit\" value=\"Submit\">".
           "<tr>".
         "</tr>".
      "</form>".
     "</table>".
   "</div>"; 
Run Code Online (Sandbox Code Playgroud)

显示:

if(isset($_FILES['file'])) //file uploaded
{
  $file_raw = file_get_contents($_FILES['file']['tmp_name']);
  $file     = pg_escape_bytea($file_raw);
  //Here is Code to insert into Database but just to test, I try it directly:

  header('Content-Type: image/png');
  echo pg_unescape_bytea($file);
}
Run Code Online (Sandbox Code Playgroud)

我已将显示部分放在一个额外的文件中,依此类推,但这些是您需要了解的基本信息.

我不会显示任何图像,只是浏览器中的"Broken Image"图标.这有什么不对?我怎么解决这个问题?谢谢!

php postgresql png bytearray

3
推荐指数
1
解决办法
4709
查看次数