我目前正在构建一个使用 Spring 来利用 websocket 支持和安全性的 Web 应用程序。问题是,我不想使用 STOMP。现在已经有大约 4 个版本没有更新了,我不需要它。因此,我按照另一个 Stackoverflow问题的答案,使用 SockJS 但不使用 STOMP 为 Websocket 配置 Spring。
现在我想集成 Spring Security 来进行 websocket 身份验证和授权。不幸的是,该文档必须为 STOMP-websockets 配置 Spring Security。
我非常感谢任何为我的案例配置 Spring Security 的帮助。有人知道这方面的教程或示例吗?我还没有找到。
I recently upgraded one of my services to Spring Boot 2.1.5.RELEASE FROM 2.0.9.RELEASE. And I can't really go back, because I need some of the new features. The Spring Security Version pulled by Spring Boot is 5.1.5.RELEASE. Furthermore I'm using spring-security-jwt, version 1.0.10.RELEASE, and spring-security-oauth2', version 2.3.6.RELEASE.'
All unit and integration tests are fine and I was just about to release it when the "real world" test that uses the jar-file built by gradle blew up. When trying to …
我想在 react-native 中拦截我的 webview 中链接的点击并执行自定义操作,而不是按照官方指南中的描述导航到链接的目标。这是我所做的:
import React from 'react';
import {View, Linking} from 'react-native';
import AsyncStorage from '@react-native-community/async-storage';
import {WebView} from 'react-native-webview';
export default class WebViewScreen extends React.Component {
static navigationOptions = {
title: 'Produck',
};
constructor(props) {
super(props);
}
/**
* Defines content and look of the WebViewScreen.
*/
render() {
const DEFAULT_URL = "https://www.myurl.de/index.html";
return (
<View style={{ flex: 1 }}>
<WebView
ref = {webview => {
this.myWebView = webview;
}}
renderLoading = {this.renderLoading}
startInLoadingState = …Run Code Online (Sandbox Code Playgroud) 我的实际问题是 Spring Security 和为身份验证服务器配置 OAuth2,但是为了在那里跟踪我的问题,我希望 Spring 告诉我当请求到达端点时实际发生了什么。我正在使用 Spring Boot 2.0.0-SNAPSHOT 和日志记录启动器spring-boot-starter-log4j2,实际上它似乎工作得很好。我的 log4j2 配置是:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configuration>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%-5level%d{MMM dd, yyyy HH:mm:ss.SSS} [%t] %X %logger{36}%n %msg%n"/>
</Console>
<File name="File" fileName="logs/application.log">
<PatternLayout pattern="%-5level%d{MMM dd, yyyy HH:mm:ss.SSS} [%t] %X %logger{36} %msg%n"/>
</File>
</Appenders>
<Loggers>
<Root level="debug">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</Root>
<logger name="org.springframework" level="debug" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</logger>
<logger name="org.springframework.security" level="debug" additivity="false">
<AppenderRef ref="Console"/>
<AppenderRef ref="File"/>
</logger>
<logger name="org.hibernate" level="info" additivity="false"> …Run Code Online (Sandbox Code Playgroud) java ×3
spring-boot ×2
gradle ×1
javascript ×1
log4j2 ×1
logging ×1
oauth-2.0 ×1
react-native ×1
security ×1
sockjs ×1
spring ×1
websocket ×1