token

How to create a password-less login for mobile app

无人久伴 提交于 2019-12-09 05:51:10
问题 I'm intested in building some kind of password-less login between a mobile app and an API (assuming I can control both). The motivation is that having to login is very annoying for users and has security risks (eg. users will reuse existing passwords) and I want the users to be able to get started with the app immediately. I'm wondering if there are some techniques that could work. For instance: Generate and random login/password on the mobile device and store the password in the keychain.

Glassfish @RolesAllowed with custom SecurityContext

柔情痞子 提交于 2019-12-09 04:57:41
问题 The question i'm about to ask is a bit tricky and I haven't found any answer yet. Maybe because i'm looking for the wrong thing. But i hope you will help me on this. I used the following tutorial to implement a custom SecurityContext that uses tokens instead of basic user/password authentication. Basically it initializes and injects a ResourceFilterFactory that will itself inject a ResourceFilter at every HTTP request sent to the application. This ResourceFilter searches for the

Redmine can't generate secret token

穿精又带淫゛_ 提交于 2019-12-08 19:30:37
I have problem with generating secret token. I'm was trying this: [redmine]# rake generate_secret_token rake aborted! LoadError: cannot load such file -- rspec/core /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in require' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:251:in block in require' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.19/lib/active_support/dependencies.rb:236:in load_dependency' /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activesupport-3.2.19/lib/active

PHP Token replaces html entities

早过忘川 提交于 2019-12-08 19:30:35
I want to make certain words/strings like links if found in the text. I have a piece of code from php.bet which does that, but it also removes the beginning and end of tags from <a href="http://www.domain.com/index.php" title="Home">go to homepage</a> . Can you help solve this? Here's the piece of code: <?php $str_in = '<p>Hi there worm! You have a disease!</p><a href="http://www.domain.com/index.php" title="Home">go to homepage</a>'; $replaces= array( 'worm' => 'http://www.domain.com/index.php/worm.html', 'disease' => 'http://www.domain.com/index.php/disease.html' ); function addLinks($str_in

高并发下的接口幂等性解决方案

拈花ヽ惹草 提交于 2019-12-08 18:49:33
一、背景 我们实际系统中有很多操作,是不管做多少次,都应该产生一样的效果或返回一样的结果。 例如: 前端重复提交选中的数据,应该后台只产生对应这个数据的一个反应结果。 我们发起一笔付款请求,应该只扣用户账户一次钱,当遇到网络重发或系统bug重发,也应该只扣一次钱; 发送消息,也应该只发一次,同样的短信发给用户,用户会哭的; 创建业务订单,一次业务请求只能创建一个,创建多个就会出大问题。 等等很多重要的情况,这些逻辑都需要幂等的特性来支持。 二、幂等性概念 幂等(idempotent、idempotence)是一个数学与计算机学概念,常见于抽象代数中。 在编程中.一个幂等操作的特点是其任意多次执行所产生的影响均与一次执行的影响相同。幂等函数,或幂等方法,是指可以使用相同参数重复执行,并能获得相同结果的函数。 这些函数不会影响系统状态,也不用担心重复执行会对系统造成改变。例如,“getUsername()和setTrue()”函数就是一个幂等函数. 更复杂的操作幂等保证是利用唯一交易号(流水号)实现. 我的理解:幂等就是一个操作,不论执行多少次,产生的效果和返回的结果都是一样的 三、技术方案 1. 查询操作 查询一次和查询多次,在数据不变的情况下,查询结果是一样的。select是天然的幂等操作 2. 删除操作 删除操作也是幂等的,删除一次和多次删除都是把数据删除。

Share default OWIN tokens in .Net core

蹲街弑〆低调 提交于 2019-12-08 17:40:34
问题 I have Authorization server which built on .NET 4.5.1 and use Microsoft.Owin.Security.OAuth Version=3.0.0 http://prntscr.com/hvwhl4 Tokens protected via machinkey (OAuthAuthorizationServerOptions.AccessTokenFormat is default). I also have many application-consumers(resource servers) on .NET 4.5.1 which validate these tokens http://prntscr.com/hvwwdu http://prntscr.com/hvwiwr. All these applications have the same machinkey in web.config Now I try to build .net core 2.0 application and I need

Are “>>”s in type parameters tokenized using a special rule?

浪子不回头ぞ 提交于 2019-12-08 15:11:22
问题 I'm confused by the Java spec about how this code should be tokenized: ArrayList<ArrayList<Integer>> i; The spec says: The longest possible translation is used at each step, even if the result does not ultimately make a correct program while another lexical translation would. As I understand it, applying the "longest match" rule would result in the tokens: ArrayList < ArrayList < Integer >> i ; which would not parse. But of course this code is parsed just fine. What is the correct

the correct way of sending a stripe token with Android

僤鯓⒐⒋嵵緔 提交于 2019-12-08 09:43:32
问题 Lots of info inside! I am aware there are multiple threads going on about this issue, but non of them are properly answered, and Stripe's own tutorials and references arent much better. so hopefully I (and other) may finaly see the light in this long lasting issue for us hobby developers. I have been trying to implement Stripe's API for over 2 weeks now, still stuck at the same problem. My Android code is properly working up till the point where I receice my Token back from Stripe. public

Howto login to Azure hosted and Active Directory protected API App without ADAL?

拈花ヽ惹草 提交于 2019-12-08 08:04:40
问题 I am trying to login to my Java API backend app hosted in Azure and protected with Activty Directory. In this article I read to make this call for receiving the token: GET https://login.windows.net/developertenant.onmicrosoft.com/oauth2/authorize?response_type=id_token&client_id=aeadda0b-4350-4668-a457-359c60427122&redirect_uri=https%3A%2F%2Flocalhost%3A44326%2F&state=8f0f4eff-360f-4c50-acf0-99cf8174a58b&nonce=8b8385b9-26d3-42a1-a506-a8162bc8dc63 HTTP/1.1 But how to find out which state and

'Expiration time buffer' of SessionSecurityTokenHandler of WIF 4.5 in Azure web role

戏子无情 提交于 2019-12-08 07:33:56
问题 everyone. What does 'Expiration time buffer' mean? Let me explain this to you. In my Azure Cloud service project, there is only one Web Role. And I integrated the ACS namespace enabled with some identity provider. And the identity provider will issue an token. Anyhow, there will be a SessionSecurityToken instance. And my web role will handle its expiration. Here is the sample code, void SessionAuthenticationModule_SessionSecurityTokenReceived(object sender,