自从我重新安装Eclipse(只是删除并再次下载)后,我无法在Samsung Galaxy i9001(使用CyanogenMod - Android 4.4.2)上调试我的应用程序.它在重新安装之前工作正常.
拔下/插入,取消选中/选中"Debug Enabled",adb kill-server/adb start-server,重启手机/电脑对我不起作用.在设备授权对话框上永远不会出现(但我记得在重新安装之前出现了对话框).我不知道如何强制显示此授权对话框..android目录中没有abd_key.pub文件.当我尝试读取cpu信息DDMS说:
[2014-04-15 12:47:06 - DDMS] device unauthorized. Please check the confirmation dialog on your device.
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?是否可以手动生成密钥而无需确认对话框?
USB连接
无线连接
据说我安装了三星驱动程序.当我运行ADB设备命令时,它表示未经授权.
我已经完成了这篇文章中所说的一切:https://stackoverflow.com/a/25546300/1848376
但问题是我没有通过电话告诉我必须接受连接.
当我运行命令时adb shell
,这是答案:
error: device unauthorized.
This adbd's $ADB_VENDOR_KEYS is not set; try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Run Code Online (Sandbox Code Playgroud)我做了"adb kill-server",但它并没有改变任何东西.为什么?
我正在尝试使用spring-security-oauth2.0
基于Java的配置.我的配置已完成,但是当我在tomcat上部署应用程序并点击/oauth/token
访问令牌的url时,会Oauth
生成以下错误:
<oauth>
<error_description>Full authentication is required to access this resource</error_description>
<error>unauthorized</error>
</oauth>
Run Code Online (Sandbox Code Playgroud)
我的配置在Git中心,请点击链接
代码很大,所以请参考git.我正在使用chrome postman客户端发送请求.以下是我的要求.
POST /dummy-project-web/oauth/token HTTP/1.1
Host: localhost:8081
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=abc%40gmail.com&client_secret=12345678
Run Code Online (Sandbox Code Playgroud)
错误就像,URL是安全的Oauth
,但在配置中,我给予访问此URL的所有权限.这个问题究竟是什么?
当我尝试使用EWS API发送电子邮件时,出现以下错误:(in message.Send();
)
请求失败.远程服务器返回错误:(401)未经授权.
我的代码如下:
ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
//WebService Uri
try
{
exchangeService.Url = new Uri("https://exchangeserver/ews/exchange.asmx");
}
catch (Exception ex)
{
throw new Exception(string.Format("WebService Uri:" + ex));
}
//Credentials
try
{
exchangeService.Credentials = new WebCredentials("user@domain", "pwd", "domain");
}
catch (Exception ex)
{
throw new Exception(string.Format("Credentials:" + ex));
}
//Send a mail
try
{
EmailMessage message = new EmailMessage(exchangeService);
message.Subject = "Test";
message.Body = "Test";
message.ToRecipients.Add("destination@domain");
message.Save();
message.Send();
}
catch (Exception ex)
{
throw ex;
}
Run Code Online (Sandbox Code Playgroud)
我在本网站上阅读了有关此问题的其他帖子,但他们无法解决我的问题.
c# exchange-server-2007 unauthorized exchangewebservices http-status-code-401
我在Visual Studio 2010中打开了第三方XSD文件,该文件从同一第三方的其他模式文件中导入名称空间.
在模式文件的XML编辑器视图中,xs:import元素带有以下错误:请求类型'System.Security.Permissions.FileIOPermission',mscorlib,Version = 4.0.0.0,Culture = neutral, PublicKeyToken = b77a5c561934e089'失败了.
我阅读了以下博客文章:http://blogs.msdn.com/b/xmlteam/archive/2009/06/04/understanding-xml-schema-sets-in-the-xsd-designer.aspx,声明它是安全区域违规,Visual Studio将架构放置在XML架构资源管理器中的"未授权区域"中.
我的问题是 - 如何更改我的安全设置以允许引用这些模式,或者我可以做些什么来使与它们相关联的模式和命名空间"受信任"?
Directory.GetFiles方法在第一次遇到没有访问权限的文件夹时失败.
该方法抛出一个UnauthorizedAccessException(可以捕获),但到此时,该方法已经失败/终止.
我正在使用的代码如下:
try
{
// looks in stated directory and returns the path of all files found
getFiles = Directory.GetFiles(
@directoryToSearch,
filetype,
SearchOption.AllDirectories);
}
catch (UnauthorizedAccessException)
{
}
Run Code Online (Sandbox Code Playgroud)
据我所知,没有办法事先检查某个文件夹是否具有定义的访问权限.
在我的示例中,我正在通过网络搜索磁盘,当我遇到仅限root访问权限的文件夹时,我的程序失败了.
我们正在从Google的GCM服务中获得间歇性的401未经授权的错误.在过去,它100%的时间都在工作.问题可能与我们的路由器接受IPv6流量一致,但即使我们在适配器上禁用IPv6,问题仍然存在.它也不适用于单独的IPv4网络.我们还使用Google建议的指数退避(http://developer.android.com/google/gcm/adv.html#retry)重试我们的请求,因此问题可能会随着时间的推移而发展,我们可能没有注意到.
我们测试的所有生产IPv4和IPv6地址都列在我们的项目中:https: //console.developers.google.com
这是我们的密钥看起来,我们已经列出了我们的整个可公开访问的子网进行测试,但我也尝试过只使用单个IP地址.
有时它有效:
C:\Users\Administrator>curl --header "Authorization: key=REDACTED" --header Content-Type:"application/json" https://android.googl
eapis.com/gcm/send -d "{\"registration_ids\":[\"test\"],\"data\":{\"code\":123}
}" -k
{"multicast_id":REDACTED,"success":0,"failure":1,"canonical_ids":0,"r
esults":[{"error":"InvalidRegistration"}]}
Run Code Online (Sandbox Code Playgroud)
但是,有时我们得到这样的回应:
C:\Users\Administrator>curl --header "Authorization: key=REDACTED" --header Content-Type:"application/json" https://android.googl
eapis.com/gcm/send -d "{\"registration_ids\":[\"test\"],\"data\":{\"code\":123}
}" -k
<HTML>
<HEAD>
<TITLE>Unauthorized</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unauthorized</H1>
<H2>Error 401</H2>
</BODY>
</HTML>
Run Code Online (Sandbox Code Playgroud)
次要更新(2014年4月4日)
将设置更改为"允许任何IP"可以解决问题,但更改为任何其他IP地址会再次破坏它.
android unauthorized http-status-code-401 google-cloud-messaging
对于我的网站,我想要安全控制器(或操作)的以下行为
如果用户将正常请求重定向到登录页面(我很容易就能做到)
如果请求是Ajax类型 Request.IsAjaxRequest()==true
,则返回状态码401
我怎样才能为此创建一个过滤器?
security asp.net-mvc unauthorized asp.net-mvc-3 asp.net-mvc-2
我正在为我的Rails 3.1应用程序开发基于JSON的API.我想提供自定义失败响应而不是默认响应,即:
{"error":"You need to sign in or sign up before continuing."}
Run Code Online (Sandbox Code Playgroud)
我的API控制器包含一个before_filter调用authenticate_user!
,它正在呈现此JSON响应.
在搜索时,我遇到了这个StackOverflow问题,该问题引用了这个Devise wiki条目.不幸的是,wiki条目并不足以让我理解它告诉我的内容.具体来说,我不知道我应该把那些代码放在哪里,以便Devise/Warden知道要渲染我想要的东西.
从其他SA问题的评论来看,听起来我不需要打电话,custom_failure!
因为我使用的是高于1.2的Devise版本(具体为1.4.2).但是,wiki条目没有解释render
调用应该去哪里,以便authenticate_user!
知道使用它而不是自己的render调用.
这个render
电话在哪里?
编辑:我不只是试图改变消息本身(一个设计en.yml
配置); 我正在尝试更改响应的实际格式.具体来说,我想返回这个:
render :text => "You must be logged in to do that.", :status => :unauthorized
Run Code Online (Sandbox Code Playgroud) authorization ruby-on-rails unauthorized devise ruby-on-rails-3
我有一个 ASP .NET Core web api,我生成了一个用于授权目的的 JWT 令牌,但是每当我使用带有 Bearer 令牌标头的 Postman 发出请求时,我都会得到 401 Unauthorized。当我从使用 API 的前端尝试时也是如此。当我删除授权时一切正常
尝试将标题中的授权更改为
//[Authorize(AuthenticationSchemes = "Bearer")]
也转到 jwt.io 以确保 JWT 令牌有效。
//function where I generate JWT
public User AuthenticateAdmin(string username, string password)
{
var user = _context.User.FirstOrDefault(x => x.UserName == username && x.Password == password);
//return null if user is not found
if (user == null) return null;
//authentication successful so generate jwt token
var tokenHandler = new JwtSecurityTokenHandler();
var key = Encoding.ASCII.GetBytes(_appSettings.Secret);
var tokenDescriptor = …
Run Code Online (Sandbox Code Playgroud) unauthorized ×10
android ×3
c# ×3
adb ×2
asp.net-mvc ×1
device ×1
devise ×1
getfiles ×1
java ×1
oauth-2.0 ×1
oneplusone ×1
security ×1
usb ×1
xsd ×1
zone ×1