如何解决无法访问AuthServer时,使用OAuth2Client启动spring应用程序
我已经使用spring-boot配置了Oauth2客户端,使用oauth2client配置了spring-security。这将是驻留在客户端计算机上的胖客户端。
#include <stdio.h>
#include <stdlib.h>
struct Node {
char name[10]; // Name of the node.
int data; // The data it holds.
struct Node *parent; // The parent node.
struct Node **child; // if not NULL,points to a NULL terminated array of pointers.
};
void print(const struct Node *node) {
if (node) {
printf("Name: %s\n",node->name);
printf("Data: %d\n",node->data);
if (node->parent) {
printf("Parent: %s\n",node->parent->name);
}
if (node->child) {
printf("Children:");
for (int i = 0; node->child[i]; i++) {
printf("%s %s",i > 0 ? "," : "",node->child[i]->name);
}
printf("\n");
}
}
}
// add a child node to a parent's child list.
// return 0 upon success or an error code on failure
int add_child(struct Node *parent,struct Node *chid) {
if (parent == NULL)
return 1;
if (child == NULL)
return 2;
size_t nchild = 0;
if (parent->child != NULL) {
while (parent->child[nchild] != NULL)
nchild++;
}
struct Node *new_child = realloc(parent->child,(nchild + 2) * sizeof(*new_child));
if (new_child == NULL)
return 3;
parent->child = new_child;
parent->child[nchild++] = child;
parent->child[nchild] = NULL;
child->parent = parent;
return 0;
}
int main() {
struct Node n1 = { "Parent",1,NULL,NULL };
struct Node n2 = { "Child1",2,NULL };
struct Node n3 = { "Child2",3,NULL };
add_child(&n1,&n2);
add_child(&n1,&n3);
print(&n1);
print(&n2);
print(&n3);
return 0;
}
当我连接到互联网并且可以访问AuthServer时,一切都可以正常工作。但是,由于某种原因,无法访问AuthServer;无论是代理服务器还是缺乏互联网,我的应用程序甚至都不会开始出现以下异常情况
@Configuration
public class AppConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable().oauth2Login();
}
}
spring-boot / spring-security中是否可以配置任何方式以在后台继续尝试并使应用程序启动?像占位符/脱机bean这样的东西一旦建立连接就被填充?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。