Skip to content
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ docker run -p 8080:8080 easemob/easemob-im-live-server

- 直播间服务需调用环信REST接口,该模块提供调用环信REST服务,包含token、user、chatroom API的调用,封装了调用所需的RequestBody、ResponseBody。

#### [qiniu-service](./qiniu-service)

- 获取七牛云直播推拉流地址。

#### [agora-server](./agora-app-server)

- 获取声网token。
Expand All @@ -145,6 +141,3 @@ docker run -p 8080:8080 easemob/easemob-im-live-server
- 直播间支持点播功能
- 直播间支持Docker部署
- 直播间详情返回的成员列表过滤了owner

### 1.0.2.Final
- 支持获取七牛云推拉流地址
5 changes: 3 additions & 2 deletions agora-app-server/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# AgoraAppServer
AgoraAppServer用来获取声网Token
环信AppServer通过http接口获取Token

## 介绍
AgoraAppServer是用来获取声网Token的开源项目。
5 changes: 4 additions & 1 deletion agora-app-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@
<version>2.6</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-consul-discovery</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
* ClassName: SpringBootApplication
* description:
* author: lijian
* date: 2021-01-19 09:15
**/
@EnableDiscoveryClient
@SpringBootApplication
public class AgoraServerApplication {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

@Autowired
/*@Autowired
private SecurityAuthenticationEntryPoint unauthorizedHandler;

@Autowired
Expand All @@ -49,17 +49,17 @@ public TokenAuthenticationProcessingFilter tokenFilter() {
@Bean
public UsernameAuthenticationProcessingFilter usernameFilter() {
return new UsernameAuthenticationProcessingFilter();
}
}*/

@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder.build();
}

@Override protected void configure(AuthenticationManagerBuilder auth) throws Exception {
/* @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(tokenAuthenticationProvider);
auth.authenticationProvider(usernameProvider);
}
}*/

@Override protected void configure(HttpSecurity http) throws Exception {

Expand All @@ -69,32 +69,33 @@ public RestTemplate restTemplate(RestTemplateBuilder builder) {
.csrf()
.disable()
.exceptionHandling()
.authenticationEntryPoint(unauthorizedHandler)
//.authenticationEntryPoint(unauthorizedHandler)
.and()
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
.authorizeRequests()
.antMatchers("/",
"/management/**",
"/favicon.ico",
"/**/*.png",
"/**/*.gif",
"/**/*.svg",
"/**/*.jpg",
"/**/*.html",
"/**/*.css",
"/**/*.js")
.permitAll()
.antMatchers("/token/**", "/channel/**")
.hasAuthority("user")
.anyRequest()
.authenticated();
.anonymous();
// .authorizeRequests()
// .antMatchers("/",
// "/management/**",
// "/favicon.ico",
// "/**/*.png",
// "/**/*.gif",
// "/**/*.svg",
// "/**/*.jpg",
// "/**/*.html",
// "/**/*.css",
// "/**/*.js")
// .permitAll()
// .antMatchers("/token/**", "/channel/**")
// .hasAuthority("user")
// .anyRequest()
// .authenticated();

// 添加token auth filter
// 也可以支持username password的方式只需要配置相应的filter和provider
http.addFilterBefore(tokenFilter(), UsernamePasswordAuthenticationFilter.class);
http.addFilterAfter(usernameFilter(), TokenAuthenticationProcessingFilter.class);
//http.addFilterBefore(tokenFilter(), UsernamePasswordAuthenticationFilter.class);
//http.addFilterAfter(usernameFilter(), TokenAuthenticationProcessingFilter.class);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Collections;

@Slf4j
@Component
//@Component
public class TokenAuthenticationProvider implements AuthenticationProvider {

@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.util.Collections;

@Slf4j
@Component
//@Component
public class UsernameAuthenticationProvider implements AuthenticationProvider {

private final RestManger restManger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import java.io.IOException;

@Slf4j
@Component
//@Component
public class SecurityAuthenticationEntryPoint implements AuthenticationEntryPoint {

@Override
Expand Down
15 changes: 13 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,19 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.51</version>
<version>1.2.83</version>
</dependency>
</dependencies>


<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Greenwich.SR6</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>