首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >无法验证fiware-idm用户帐户

无法验证fiware-idm用户帐户
EN

Stack Overflow用户
提问于 2018-05-23 03:55:49
回答 1查看 174关注 0票数 0

我使用的是从源代码中构建的fiware idm最晚版本

  • 首先我唱给用户听

,这是idm的日志

代码语言:javascript
运行
AI代码解释
复制
 skip: /img/keyrock01.png nothing to do                               
    [sass]  skip: /fonts/neotechstd/neotechstd-regular.woff nothing to do        
    GET /img/keyrock01.png 304 1.480 ms - -                                      
    GET /fonts/neotechstd/neotechstd-regular.woff 304 1.200 ms - -               
    Executing (default): SELECT `id`, `username`, `description`, `website`, `imag
    e`, `gravatar`, `email`, `password`, `date_password`, `enabled`, `admin`, `st
    arters_tour_ended`, `extra`, `scope` FROM `user` AS `User` WHERE `User`.`emai
    l` = 'test@test.com' LIMIT 1;                                                
    Executing (default): SELECT `id`, `username`, `description`, `website`, `imag
    e`, `gravatar`, `email`, `password`, `date_password`, `enabled`, `admin`, `st
    arters_tour_ended`, `extra`, `scope` FROM `user` AS `User` WHERE `User`.`emai
    l` = 'test@test.com' LIMIT 1;                                                
    Executing (default): INSERT INTO `user` (`id`,`username`,`image`,`gravatar`,`
    email`,`password`,`date_password`,`enabled`,`admin`,`starters_tour_ended`) VA
    LUES ('aeb5a8fc-3ee7-48af-a0eb-7b9cf849cf8f','Test','default',false,'test@tes
    t.com','e9f7c64ec2895eec281f8fd36e588d1bc762bcca','2018-05-23 10:54:09',false
    ,false,false);                                                               
    Executing (437cc850-daa7-42ad-a04e-12094cad524c): START TRANSACTION;         
    Executing (437cc850-daa7-42ad-a04e-12094cad524c): SELECT `id`, `activation_ke
    y`, `activation_expires`, `reset_key`, `reset_expires`, `verification_key`, `
    verification_expires`, `user_email` FROM `user_registration_profile` AS `User
    _Registration_Profile` WHERE `User_Registration_Profile`.`user_email` = 'test
    @test.com' LIMIT 1;                                                          
    Executing (437cc850-daa7-42ad-a04e-12094cad524c): INSERT INTO `user_registrat
    ion_profile` (`id`,`activation_key`,`activation_expires`,`user_email`) VALUES
     (DEFAULT,'3qfo4sfc358','2018-05-24 10:54:09','test@test.com');              
    Executing (437cc850-daa7-42ad-a04e-12094cad524c): COMMIT;                    
    POST /sign_up/ 200 211.580 ms - 6803                                         
    [sass]  skip: /javascripts/jquery-3.2.1.min.js nothing to do                 
    GET /javascripts/jquery-3.2.1.min.js 304 0.876 ms - -                        
    [sass]  source: /home/ubuntu/fiware-idm/themes/default/jquery.Jcrop.scss     
    [sass]  dest: /home/ubuntu/fiware-idm/public/stylesheets/jquery.Jcrop.css    
    [sass]  read: /home/ubuntu/fiware-idm/themes/default/jquery.Jcrop.scss
  • 我没有收到任何确认邮件,所以我点击确认没有收到,这是idm日志 获取/字体/新技术/新技术标准-规则。 执行(默认):选择idusernamedescriptionwebsiteimag egravataremailpassworddate_password enabledadminst arters_tour_endedextrascope user AS User,其中User.emai l = 'test@test.com‘极限1; 执行(默认):更新user_registration_profileactivation_key=‘z0fv4m812k’,activation_expires='2018-05-24 11:07:21‘其中user_email = 'test@test.com’ POST /confirmation 302 78.040 ms - 66 sass skip: /auth/登录没有什么可做的 获取/auth/登录200 4.321 ms - 6786

使我能够验证用户

  • 我打开了mysql数据库
  • 选择idm数据库
  • 使用此UPDATE user SET enabled = 1 where email= "test@test.com";更新用户表之后,我能够正确地访问该用户的idm,但在我的示例中,我无法完成此解决方案

,所以我想问的是,从idm发送确认邮件到用户Sig的确认邮件是否成功,并且在点击这个链接后,帐户被验证,用户可以使用这个帐户访问idm,任何帮助

更新i安装smtp-并将idm配置为smtp与smtp服务器通信,并按照以下步骤验证帐户注册测试用户,这是idm的日志。

代码语言:javascript
运行
AI代码解释
复制
GET /fonts/neotechstd/neotechstd-regular.woff 304 2.783 ms - -               
[sass]  skip: /img/keyrock01.png nothing to do                               
GET /img/keyrock01.png 304 0.568 ms - -                                      
Executing (default): SELECT `id`, `username`, `description`, `website`, `imag
e`, `gravatar`, `email`, `password`, `date_password`, `enabled`, `admin`, `st
arters_tour_ended`, `extra`, `scope` FROM `user` AS `User` WHERE `User`.`emai
l` = 'testuser@testuser.com' LIMIT 1;                                        
Executing (default): SELECT `id`, `username`, `description`, `website`, `imag
e`, `gravatar`, `email`, `password`, `date_password`, `enabled`, `admin`, `st
arters_tour_ended`, `extra`, `scope` FROM `user` AS `User` WHERE `User`.`emai
l` = 'testuser@testuser.com' LIMIT 1;                                        
Executing (default): INSERT INTO `user` (`id`,`username`,`image`,`gravatar`,`
email`,`password`,`date_password`,`enabled`,`admin`,`starters_tour_ended`) VA
LUES ('f11aa78f-2d48-4b36-805c-8ca8383ef44b','Testuser','default',false,'test
user@testuser.com','c178fcf003558346bb951eae536f205ab1420401','2018-05-25 18:
49:42',false,false,false);                                                   
Executing (3b3a82b6-9c0b-44ae-9abe-f3cc4746e06f): START TRANSACTION;         
Executing (3b3a82b6-9c0b-44ae-9abe-f3cc4746e06f): SELECT `id`, `activation_ke
y`, `activation_expires`, `reset_key`, `reset_expires`, `verification_key`, `
verification_expires`, `user_email` FROM `user_registration_profile` AS `User
_Registration_Profile` WHERE `User_Registration_Profile`.`user_email` = 'test
user@testuser.com' LIMIT 1;                                                  
Executing (3b3a82b6-9c0b-44ae-9abe-f3cc4746e06f): INSERT INTO `user_registrat
ion_profile` (`id`,`activation_key`,`activation_expires`,`user_email`) VALUES
 (DEFAULT,'v9hadxsieme','2018-05-26 18:49:42','testuser@testuser.com');      
Executing (3b3a82b6-9c0b-44ae-9abe-f3cc4746e06f): COMMIT;                    
POST /sign_up/ 200 191.699 ms - 6803

这是smtp服务器的日志[

代码语言:javascript
运行
AI代码解释
复制
2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] 250-SMTPUTF8                 
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] 250-SIZE 10485760            
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] 250-XCLIENT NAME ADDR PORT PR
OTO HELO LOGIN                                                               
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] 250 XFORWARD NAME ADDR PORT P
ROTO HELO IDENT SOURCE                                                       
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] C: MAIL FROM:<noreply@localho
st>                                                                          
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] S: 250 Accepted              
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] C: RCPT TO:<testuser@testuser
.com>                                                                        
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] S: 250 Accepted              
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] C: DATA                      
[2018-05-25 18:49:43] DEBUG [#7o7cqgw2g77rqfs7] S: 354 End data with <CR><LF>
.<CR><LF>                                                                    
Content-Type: text/html; charset=utf-8                                       
From: noreply@localhost                                                      
To: testuser@testuser.com                                                    
Subject: Welcome to Keyrock                                                  
Message-ID: <c4b64133-9a38-39ab-bc98-0fd5647040b1@localhost>                 
Content-Transfer-Encoding: quoted-printable                                  
Date: Fri, 25 May 2018 18:49:43 +0000                                        
MIME-Version: 1.0                                                            

<!DOCTYPE html>                                    
<html>                                             
<head>                                             
    <meta content=3D"text/html; =                  
charset=3DUTF-8" http-equiv=3D"Content-Type">      
</head>                                            
<body>                                             
    <table style=3D"background-color: #F1F1F2; min-
height: 300px; =                                   
padding-bottom: 40px; border:0; font-family: verdan
a, arial, sans-serif;" =                           
cellpadding=3D"0" cellspacing=3D"0" width=3D"100%">
      <tr>                                         
        <td align=3D"center" valign=3D"top">       
          <table =                                 
style=3D"padding: 15px 0px; border:0;" cellpadding=
3D"0" cellspacing=3D"0" =                          
width=3D"700">                                     
             <tr style=3D"background-color: #F1F1F2
; =                                                
min-height: 80px; display: block;">                
              <td =                                
style=3D"background-color: white; width:700px;">   
                <img =                             
title=3D'Keyrock' alt=3D'Keyrock' style=3D"height: 
70px;" =                                           
src=3D"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaH
aWlpb0QvLzJRPT0iL
z48L3N2Zz4=3D">                                    
              </td></tr>                           
              <tr style=3D"height: auto; padding: =
20px 15px 10px; color: #666; background-color: #FFF
; font-size: 13px;">                               
                <td>                               
                    <table style=3D"height: auto; =
padding: 20px 15px 10px; color: #666; background-co
lor: #FFF; font-size: =                            
13px;">                                            
                      <tr><td>                     
                                    =              
              <p>Hello Testuser1!</p>              

<p>Welcome to Keyrock! By clicking =               
on the link "I accept" below, you state that you ha
ve read and accepted the=                          
 our Terms and Conditions and the creation of your 
account will be =                                  
confirmed:</p>                                     

<p><a href=3D"http://localhost:3000/activate?=     
activation_key=3Dpr93n16tgk8&amp;email=3Dtestuser1@
testuser1.com" =                                   
target=3D"_blank">I accept</a></p>                 
        =20                                        
                                              </td>
</tr>                                              
                    </table>                       
                </td>                              
              </tr>                                
              <tr>                                 
                <td style=3D"border-top:1px solid =
#48B9C9;"></td>                                    
              </tr>                                
              <tr>                                 
                <td style=3D"border-top: 1px solid 
#FF0; border-bottom: 1px=                          
 solid #193B6B; height: 0px; width: 100%; display:b
lock;"></td>                                       
              </tr>                                
              <tr style=3D"background-color: #FFF;"
>   =                                              
          =20                                      
                <td style=3D"padding:15px 15px 0px;
 display: =                                        
block; padding-bottom: 30px; font-size: 11px;">    
                    2018 =                         
=C2=A9=20                                          
                    <a style=3D"color: #193B6B; tex
t-decoration: =                                    
none;" href=3D"https://github.com/ging" onMouseOver
=3D "this.style.=                                  
cssText=3D 'color: #48B9C9; text-decoration: none;'
" onMouseOut=3D "this.=                            
style.cssText=3D 'color: #193B6B; text-decoration: 
none;'">GING DIT</a>- =                            
Universidad Polit=C3=A9nica de Madrid.             
                </td>                              
              </tr>                                
          </table>                                 
        </td>                                      
      </tr>                                        
  </table>                                         
</body>                                            
</html>

[

代码语言:javascript
运行
AI代码解释
复制
2018-05-25 19:01:58] DEBUG [#bjwvvi7anyru4k3d] C: <19
949 bytes of DATA>                                    
[2018-05-25 19:01:58] DEBUG [#bjwvvi7anyru4k3d] S: 250
 Message queued as abcd                               
ef                                                    
[2018-05-25 19:01:58] INFO  [#bjwvvi7anyru4k3d] Connec
tion closed to [127.0.0                               
.1]                                                   

我从smtp服务器日志中复制HTML,这是电子邮件.发送给用户

当我点击时,我接受,我得到了这个错误

因此,我从日志中复制激活链接,即“key=3Dpr93n16tgk8&email=3Dtestuser1@testuser1.com”。

我得到了无效的csrf令牌作为响应,这是idm的日志。

代码语言:javascript
运行
AI代码解释
复制
ass]  skip: /fonts/neotechstd/neotechstd-regular.woff nothing to do                     
[sass]  skip: /img/keyrock01.png nothing to do                                            
GET /fonts/neotechstd/neotechstd-regular.woff 304 1.087 ms - -                            
GET /img/keyrock01.png 304 0.904 ms - -                                                   
[sass]  skip: /activate nothing to do                                                     
Executing (default): SELECT `User_Registration_Profile`.`id`, `User_Regi s t  ra t        
ion_Profile`.`activation_key`, `User_Registration_Profile`.`activation_e x p  ir e        
s`, `User_Registration_Profile`.`reset_key`, `User_Registration_Profile` . `  re s        
et_expires`, `User_Registration_Profile`.`verification_key`, `User_Regis t r  at i        
on_Profile`.`verification_expires`, `User_Registration_Profile`.`user_em a i  l` ,        
 `User`.`id` AS `User.id`, `User`.`username` AS `User.username`, `User`. ` d  es c        
ription` AS `User.description`, `User`.`website` AS `User.website`, `Use r `  .` i        
mage` AS `User.image`, `User`.`gravatar` AS `User.gravatar`, `User`.`ema i l  `  A        
S `User.email`, `User`.`password` AS `User.password`, `User`.`date_passw o r  d`          
AS `User.date_password`, `User`.`enabled` AS `User.enabled`, `User`.`adm i n  `  A        
S `User.admin`, `User`.`starters_tour_ended` AS `User.starters_tour_ende d `  ,  `        
User`.`extra` AS `User.extra`, `User`.`scope` AS `User.scope` FROM `user _ r  eg i        
stration_profile` AS `User_Registration_Profile` LEFT OUTER JOIN `user`  A S   ` U        
ser` ON `User_Registration_Profile`.`user_email` = `User`.`email` WHERE  ` U  se r        
_Registration_Profile`.`user_email` = '3Dtestuser1@testuser1.com' LIMIT  1 ;              
GET /activate?=activation_key=3Dpr93n16tgk8&email=3Dtestuser1@testuser1. c o  m  4        
03 21.857 ms - 18                                                                         
[sass]  skip: /activate nothing to do

我将URL更改为

"key=3Dpr93n16tgk8&email=testuser1@testuser1.com

但是获取危险:在此步骤之后激活用户和这个idm日志时出错

代码语言:javascript
运行
AI代码解释
复制
Executing (default): SELECT `User_Registration_Profile`.`id`, `User_Registration_Profile`.        
`activation_key`, `User_Registration_Profile`.`activation_expires`, `User_Registration_Pro        
file`.`reset_key`, `User_Registration_Profile`.`reset_expires`, `User_Registration_Profile        
`.`verification_key`, `User_Registration_Profile`.`verification_expires`, `User_Registrati        
on_Profile`.`user_email`, `User`.`id` AS `User.id`, `User`.`username` AS `User.username`,         
`User`.`description` AS `User.description`, `User`.`website` AS `User.website`, `User`.`im        
age` AS `User.image`, `User`.`gravatar` AS `User.gravatar`, `User`.`email` AS `User.email`        
, `User`.`password` AS `User.password`, `User`.`date_password` AS `User.date_password`, `U        
ser`.`enabled` AS `User.enabled`, `User`.`admin` AS `User.admin`, `User`.`starters_tour_en        
ded` AS `User.starters_tour_ended`, `User`.`extra` AS `User.extra`, `User`.`scope` AS `Use        
r.scope` FROM `user_registration_profile` AS `User_Registration_Profile` LEFT OUTER JOIN `        
user` AS `User` ON `User_Registration_Profile`.`user_email` = `User`.`email` WHERE `User_R        
egistration_Profile`.`user_email` = 'testuser1@testuser1.com' LIMIT 1;                            
GET /activate?=activation_key=3Dpr93n16tgk8&email=testuser1@testuser1.com 200 22.253 ms -         
6750

,所以我很困惑为什么在我得到激活链接之后,会检查用户帐户

EN

回答 1

Stack Overflow用户

发布于 2018-05-23 08:36:25

在早期版本的IdM (<5.0)中,除非设置了电子邮件服务器以发送确认邮件,否则必须在应用程序日志中搜索确认链接。这是因为IdM抛出一个异常并记录无法发送的邮件。

在最新版本的IdM中,这种情况可能已经发生了变化,因为它们改变了组件的实现。我建议您尝试降低从INFO到DEBUG的日志记录的严重性,以查看确认电子邮件是否已保存。

另一方面,如果您想配置电子邮件服务器,请在config.js中定义适合您的情况的值​​。

无论如何,据我所知,而且仅仅是出于实际目的,您的解决方案是完全有效的!

诚挚的问候!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50487802

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档