簡體   English   中英

無法驗證fiware-idm用戶帳戶

[英]Can't verify fiware-idm user Account

我正在使用來自源的Fiware IDM Leatest版本構建

  • 首先我要唱給用戶 在此處輸入圖片說明

這是idm的日志

 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日志

    GET /fonts/neotechstd/neotechstd-regular.woff 304 1.080 ms--
    執行中(默認):SELECT idusernamedescription
    websiteimag egravataremailpassworddate_password
    enabledadminst arters_tour_endedextrascope FROM
    user AS User WHERE User emai l ='test@test.com'LIMIT 1;
    執行(默認):UPDATE user_registration_profile SET
    activation_key ='z0fv4m8l12k', activation_expires ='2018-05-24
    11: user_email :21'WHERE user_email ='test@test.com'
    POST /確認302 78.040毫秒-66
    [sass]跳過:/ auth / login無事可做
    GET / auth / login 200 4.321毫秒-6786

對我來說可以驗證用戶

  • 我打開了mysql數據庫
  • SELECT IDM數據庫
  • 使用UPDATE user SET enabled = 1 where email= "test@test.com";UPDATE user SET enabled = 1 where email= "test@test.com";更新用戶表UPDATE user SET enabled = 1 where email= "test@test.com"; 之后,我可以正確訪問該用戶的IDM,但在我的情況下,我無法執行此解決方法

所以我想問是否有從idm向用戶成功發送確認郵件的步驟,請通過驗證鏈接發送郵件。在鏈接鏈接之后,驗證帳戶,用戶可以使用此帳戶訪問idm的任何幫助

更新我安裝了smtp-server並配置了idm以與smtp-server進行通信,並按照以下步驟來驗證帳戶-注冊測試用戶,這是idm的日志

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-server [

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>

[

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,這是電子郵件。 發送給用戶 在此處輸入圖片說明

當我單擊我接受時 ,出現此錯誤 ñ

因此,我從“ http:// localhost:3000 / activate?=activation_key=3Dpr93n16tgk8&email=3Dtestuser1@testuser1.com ”日志中復制了激活鏈接。

我收到無效的CSRF令牌作為響應,這是IDM的日志

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

我將網址更改為

http://147.27.60.37:3000/activate?=activation_key=3Dpr93n16tgk8&email=testuser1@testuser1.com

但是有危險:在執行此步驟后, 激活用戶和IDM日志時出錯

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

所以我很困惑為什么激活后我的IDM驗證用戶帳戶的鏈接有任何建議

在以前版本的IdM(<5.0)中,除非您設置電子郵件服務器以發送確認電子郵件,否則必須在應用程序日志中搜索確認鏈接。 這是因為IdM拋出異常並記錄了無法發送的郵件。

在IdM的最新版本中,這可能已更改,因為它們在很大程度上改變了組件的實現。 我建議您嘗試降低從INFO到DEBUG的日志記錄的嚴重性,以查看是否保存了確認電子郵件。

另一方面,如果要配置電子郵件服務器,請在config.js中定義適合您情況的值。

無論如何,據我所知並且僅出於實際目的,您的解決方法是完全有效的!

最好的祝福!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM