doujiong2533 2015-05-12 22:32
浏览 109

Ion Auth不允许使用包含&符号的密码

I'm developing a bespoke web system for a client using CodeIgniter and Ion Auth. Everything has been going fine so far however I have just come across an issue whereby if I try to set a password with an ampersand in, that user can no longer log in to the system.

At first I thought this issue may be related to character coding as I was setting the passwords manually using a literal string, however the same happens if I take the input directly from a HTML form. I haven't changed any encryption/hash settings in Ion Auth, only the site title, default user group, and the table attribute used for the username.

I'm using CodeIgniter 3 and Ion Auth. Please let me know if you need anymore information.

Any ideas what is happening here?

  • 写回答

1条回答 默认 最新

  • duanbinian2243 2015-05-17 18:47
    关注

    I've just discovered the issue, and it has made me feel just a little bit daft but I thought I'd let everyone else know the solution because if I've had this issue, I'm sure somebody else is bound to.

    The problem was nothing to do with Ion Auth, but instead to with me incorrectly using CodeIgniter functions. To obtain the password from the form, I was using set_value('password) which actually escapes values for HTML as documented here and written about here. Obviously by just printing the password using echo, which was how I was attempting to debug, I couldn't see that the the original string was being altered in any way but it made a difference to the hash.

    The solution is to simply use $this->input->post('password') to get the password instead, as this function makes no changes to the original input.

    Hope that helps somebody. The moral of the story is to get familiar with any framework before you start using it and read the documentation thoroughly.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。