package com.css.simulation.oauth.server.cofiguration.oauth;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.oauth2.provider.code.AuthorizationCodeServices;
import org.springframework.security.oauth2.provider.code.InMemoryAuthorizationCodeServices;

@Configuration
public class MyCodeService {

    /**
     * 授权码存储
     * 设置授权码模式的授权码如何存储。
     */
    @Bean
    public AuthorizationCodeServices authorizationCodeServices() {
        // 基于内存的授权码存储
        // 还有 JdbcAuthorizationCodeServices、RandomValueAuthorizationCodeServices
        return new InMemoryAuthorizationCodeServices();
    }
}
