2016-05-16 7 views
0
私はきちんと私のjdbcAuthorizationCodeServiceを設定するにはどうすればよい

春のOauth認証コードの設定

だからここに私の設定

@Override 
     public void configure(AuthorizationServerEndpointsConfigurer endpoints) 
       throws Exception { 
      endpoints 
        .tokenStore(this.tokenStore) 
        .authenticationManager(this.authenticationManager) 
        .authorizationCodeServices(this.jdbcAuthorizationCodeServices).userApprovalHandler(new DefaultUserApprovalHandler()); 
     } 

の主旨だと私のテーブルは、私の質問があり、この

enter image description here

ように構成されています。認証列のサンプル値はどのようにする必要がありますか?それはbyteaのだから、春のOAuth2

答えて

0

で必要とされる認証の欄には、呼び出しで受信OAuth2Authenticationオブジェクトの直列化されたバージョンを格納します。

これはjdbcAuthorizationCodeServiceクラス

@Override 
    protected void store(String code, OAuth2Authentication authentication) { 
     jdbcTemplate.update(insertAuthenticationSql, 
       new Object[] { code, new 
SqlLobValue(SerializationUtils.serialize(authentication)) }, new int[] { 
         Types.VARCHAR, Types.BLOB }); 
    } 
からのコードです