- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.xpn.xwiki.user.api.XWikiAuthService
类的一些代码示例,展示了XWikiAuthService
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XWikiAuthService
类的具体详情如下:
包路径:com.xpn.xwiki.user.api.XWikiAuthService
类名称:XWikiAuthService
暂无
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public static Principal authenticate(String username, String password, XWikiContext context) throws XWikiException
{
return context.getWiki().getAuthService().authenticate(username, password, context);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public XWikiUser checkAuth(XWikiContext context) throws XWikiException
{
return getAuthService().checkAuth(context);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public void showLogin(XWikiContext context) throws XWikiException
{
XWikiAuthService authservice = getAuthService(context);
if (authservice == null)
super.showLogin(context);
else {
try {
authservice.showLogin(context);
} catch (Exception e) {
super.showLogin(context);
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public static Principal authenticate(String username, String password, XWikiContext context) throws XWikiException
{
return context.getWiki().getAuthService().authenticate(username, password, context);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Check authentication from request and set according persitent login information If it fails user is unlogged
*
* @return null if failed, non null XWikiUser if sucess
* @throws XWikiException
*/
public XWikiUser checkAuth() throws XWikiException
{
return this.context.getWiki().getAuthService().checkAuth(this.context);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-security-bridge
/**
* Show the login page, unless the wiki is configured otherwise.
* @param context the context
*/
private void showLogin(XWikiContext context)
{
try {
if (context.getRequest() != null
/*
* We must explicitly check the action from the context, as some templates that are
* rendered may call checkAccess with different actions (which, strictly speaking is
* incorrect, those templates should use hasAccessLevel). In particular, 'menuview.vm'
* will call checkAccess with action 'view', if the document 'XWiki.XWikiLogin' exists.
*/
&& !LOGIN_ACTION.equals(context.getAction())
&& !context.getWiki().Param("xwiki.hidelogin", "false").equalsIgnoreCase("true")) {
context.getWiki().getAuthService().showLogin(context);
}
} catch (XWikiException e) {
LOGGER.error("Failed to show login page.", e);
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public Principal authenticate(String username, String password, XWikiContext context) throws XWikiException
{
XWikiAuthService authservice = getAuthService(context);
if (authservice == null)
return super.authenticate(username, password, context);
else {
try {
return authservice.authenticate(username, password, context);
} catch (Exception e) {
return super.authenticate(username, password, context);
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Check authentication from username and password and set according persitent login information If it fails user is
* unlogged
*
* @param username username to check
* @param password password to check
* @param rememberme "1" if you want to remember the login accross navigator restart
* @return null if failed, non null XWikiUser if sucess
* @throws XWikiException
*/
public XWikiUser checkAuth(String username, String password, String rememberme) throws XWikiException
{
return this.context.getWiki().getAuthService().checkAuth(username, password, rememberme, this.context);
}
代码示例来源:origin: org.phenotips/phenotips-security-bridge
@Override
public boolean checkAccess(String action, XWikiDocument doc, XWikiContext context) throws XWikiException
{
DocumentReference userReference = getCurrentUser(context);
User user = this.userManager.getUser(userReference != null ? userReference.toString() : null, true);
boolean result = this.service.hasAccess(user, actionToRight(action), doc.getDocumentReference());
if (!result && context.getUserReference() == null && !"login".equals(context.getAction())) {
this.logger.debug("Redirecting unauthenticated user to login, since it have been denied [{}] on [{}].",
actionToRight(action), doc.getDocumentReference());
context.getWiki().getAuthService().showLogin(context);
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
@Override
public boolean checkSecret(Request request, String identifier, char[] secret)
{
ComponentManager componentManager =
(ComponentManager) getContext().getAttributes().get(Constants.XWIKI_COMPONENT_MANAGER);
XWikiContext xwikiContext = Utils.getXWikiContext(componentManager);
XWiki xwiki = Utils.getXWiki(componentManager);
try {
Principal principal = xwiki.getAuthService().authenticate(identifier, new String(secret), xwikiContext);
if (principal != null) {
String xwikiUser = principal.getName();
xwikiContext.setUser(xwikiUser);
getLogger().log(Level.FINE, String.format("Authenticated as '%s'.", identifier));
return true;
}
} catch (XWikiException e) {
getLogger().log(Level.WARNING, "Exception occurred while authenticating.", e);
}
getLogger().log(Level.WARNING, String.format("Cannot authenticate '%s'.", identifier));
return false;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public XWikiUser checkAuth(XWikiContext context) throws XWikiException
{
XWikiAuthService authservice = getAuthService(context);
if (authservice == null)
return super.checkAuth(context);
else {
try {
return authservice.checkAuth(context);
} catch (Exception e) {
return super.checkAuth(context);
}
}
}
代码示例来源:origin: phenotips/phenotips
@Override
public boolean checkAccess(String action, XWikiDocument doc, XWikiContext context) throws XWikiException
{
DocumentReference userReference = getCurrentUser(context);
User user = this.userManager.getUser(userReference != null ? userReference.toString() : null, true);
boolean result = this.service.hasAccess(user, actionToRight(action), doc.getDocumentReference());
if (!result && context.getUserReference() == null && !"login".equals(context.getAction())) {
this.logger.debug("Redirecting unauthenticated user to login, since it have been denied [{}] on [{}].",
actionToRight(action), doc.getDocumentReference());
context.getWiki().getAuthService().showLogin(context);
}
return result;
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Login.
*
* @return A token to be used in subsequent calls as an identification.
* @throws Exception If authentication fails.
*/
public String login(String userName, String password) throws Exception
{
String token;
Principal principal = this.xwiki.getAuthService().authenticate(userName, password, this.xwikiContext);
if (principal != null) {
// Generate "unique" token using a random number
token = this.xwiki.generateValidationKey(128);
String ip = this.xwikiContext.getRequest().getRemoteAddr();
XWikiUtils.getTokens(this.xwikiContext).put(token, new XWikiXmlRpcUser(principal.getName(), ip));
return token;
} else {
throw new Exception(String.format("[Authentication failed for user '%s']", userName));
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
public XWikiUser checkAuth(String username, String password, String rememberme, XWikiContext context)
throws XWikiException
{
XWikiAuthService authservice = getAuthService(context);
if (authservice == null)
return super.checkAuth(username, password, rememberme, context);
else {
try {
return authservice.checkAuth(username, password, rememberme, context);
} catch (Exception e) {
return super.checkAuth(username, password, rememberme, context);
}
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
if (context.getRequest() != null) {
if (!context.getWiki().Param("xwiki.hidelogin", "false").equalsIgnoreCase("true")) {
context.getWiki().getAuthService().showLogin(context);
if (context.getRequest() != null
&& !context.getWiki().Param("xwiki.hidelogin", "false").equalsIgnoreCase("true")) {
context.getWiki().getAuthService().showLogin(context);
代码示例来源:origin: org.phenotips/patient-data-sharing-receiver-api
String password = request.getParameter(ShareProtocol.CLIENT_POST_KEY_NAME_PASSWORD);
if (context.getWiki().getAuthService().authenticate(userName, password, context) == null) {
return generateFailedCredentialsResponse();
代码示例来源:origin: org.xwiki.platform/xwiki-platform-gwt-api
@Override
public String login(String username, String password, boolean rememberme) throws XWikiGWTException
{
try {
XWikiContext context = getXWikiContext();
XWikiUser user =
context.getWiki().getAuthService().checkAuth(username, password, rememberme ? "yes" : "no", context);
if (user == null)
return "XWiki.XWikiGuest";
else
return user.getUser();
} catch (Exception e) {
throw getXWikiGWTException(e);
}
}
代码示例来源:origin: phenotips/phenotips
String password = request.getParameter(ShareProtocol.CLIENT_POST_KEY_NAME_PASSWORD);
if (context.getWiki().getAuthService().authenticate(userName, password, context) == null) {
return generateFailedCredentialsResponse();
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-rest-server
XWikiUser xwikiUser = xwiki.getAuthService().checkAuth(xwikiContext);
if (xwikiUser != null) {
export class UserListComponent implements OnInit{ users; constructor(private userService: UserS
我最近在我的系统中遇到了 Java 语言环境的问题,我试图用这个配置运行一个项目: -Duser.language=pt_BR -Duser.country=BR 谷歌搜索后,我找到了this sit
1 当我希望出现注册错误时,我的代码出现问题:管理器不可用; 'auth.User' 已替换为 'users.User' ,我尝试解决其他问题,与 Manager 不可用相同; 'auth.User'
Loopback 非常酷,但这是我迄今为止遇到的一个缺点,我真的不确定如何解决它。内置用户模型在我的 MongoDB 数据库中生成一个名为“User”的集合,当我尝试根据 Loopback.js 自己
我在 aws cognito 中有以下用户组。行政成员付费成员(member) 我想在所有用户注册我的应用程序时将所有用户默认分配到 Member 用户组,这样我就可以为该用户组分配不同的 IAM A
blogsIndex.blade.php @extends('layouts.default') @section('details')
我正在尝试在Rails 3开发环境中使用sqlite3而不是MySQL,但是遇到了问题。尝试执行rake db:migrate时,我得到: SQLite3::SQLException: no such
尝试使用 构建 API Phoenix v1.3 按照本教程: https://dreamconception.com/tech/phoenix-full-fledged-api-in-five-mi
我正在使用通过模板 cookie-cutter 创建的 Django。当我尝试在本地使用 docker 运行项目时,出现以下错误。 FATAL: password authentication fai
我正在尝试使用 node.js/adonis 创建新用户 我创建了这两个函数: const User = use("App/Models/User") async store ({ request,
我想安排一些事情,例如 GET 请求 http://example.com/user/foo@bar.com 内部调用脚本 /var/www/example.com/rest/user/GET.php
我是一名具有可用性工程背景的软件开发人员。当我在研究生院学习可用性工程时,其中一位教授有一句口头禅:“你不是用户”。我们的想法是,我们需要将 UI 设计基于实际的用户研究,而不是我们自己关于 UI 应
您好,我正在制作一个使用互联网发送消息的消息传递应用程序。我需要从用户 a 向用户 b 发出通知。 我使用这段代码: if (toUser!= nil){ parseMessage[@
在 ruby/ror 中你可以这样做: user = User.new(params[:user]) 它使用发布表单中的值填充新对象。 使用 django/python 可以完成类似的事情吗? 最
每当我编辑用户的角色时,用户都需要注销并重新登录以查看更改。提升用户时没有问题,因为他们在再次登录之前不会看到额外的权限。但是,当降级发生时,用户仍将保留其现有角色,这会带来安全风险。想象一下,撤销一
我的核心数据有线问题。使用 iOS 10 中的 Swift3,每次使用 获取或存储数据时,我都会获得托管对象上下文 func getContext () -> NSManagedObjectCont
我发现当我使用 users_path(user) 时它返回 /users.id 其中 id 是用户的 ID 但我希望它返回 /用户/ID。我的配置 routes.rb 如下所示。 # config/r
我的应用程序在我的测试设备上正常运行(当我通过 ADT 安装它时,当我通过导出的 APK 文件安装它时)但它在 Play Store 测试设备上失败并出现以下错误: Permission Denial
创建模型的第一个条目会抛出错误 我执行了以下命令进行迁移 manage.py makemigrations manage.py migrate 在我执行这些命令以在数据库中创建第一个“数据”之后,一切
我正在尝试实现一个 getter,但它在下面代码 fragment 的最后一行向我显示了这个错误。 代码是—— class AuthRepository extends BaseAuthReposit
我是一名优秀的程序员,十分优秀!