Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

JWT Token Authentication #2214


User avatar
0
vnetonline created

I am trying to use the JWT Token Authentication by using postman to request a token by going to the following address

<a class="postlink" href="http://localhost:6240/jwt-token/authenticate">http://localhost:6240/jwt-token/authenticate</a>

I am getting a Status 200 OK, however i am having the following response

<!DOCTYPE html>

    
        
        <html lang="en" dir=>
            
            <head>
                <meta charset="utf-8" />
                <title>AppConnect</title>
                <meta http-equiv="X-UA-Compatible" content="IE=edge">
                <meta content="width=device-width, initial-scale=1.0" name="viewport" />
                <meta http-equiv="Content-type" content="text/html; charset=utf-8">
                <meta content="AppConnect" name="description" />
                <meta content="AppConnect" name="keywords">
                <meta content="AppConnect" name="author" />
                <link rel="shortcut icon" href="/favicon.ico" />
                <link href="/Content/fonts-open-sans.css" rel="stylesheet" type="text/css" />
                <link rel="stylesheet" type="text/css" href="/Content/font-awesome.min.css?v=636175753326229755" />
                <link rel="stylesheet" type="text/css" href="/libs/simple-line-icons/simple-line-icons.min.css?v=636175753462769460" />
                <link rel="stylesheet" type="text/css" href="/libs/bootstrap/css/bootstrap.min.css?v=636175753350929457" />
                <link rel="stylesheet" type="text/css" href="/libs/jquery-uniform/css/uniform.default.css?v=636175753424449461" />
                <link rel="stylesheet" type="text/css" href="/metronic/assets/global/css/components-md.css?v=636175753516409495" />
                <link rel="stylesheet" type="text/css" href="/metronic/assets/global/css/plugins-md.css?v=636175753518069477" />
                <link rel="stylesheet" type="text/css" href="/Views/Error/_Layout.css?v=636175753704869461" />
                <script type="text/javascript">
        
        var abp = abp || {}; abp.appPath = '/';
  </script>
            </head>
            <body class="page-404-full-page">
                <div class="row">
                    <div class="col-md-12 page-404">
                        <div class="number font-red"> 404 </div>
                        <div class="details">
                            <h3>Oops! You&#39;re lost.</h3>
                            <p>
        We can not find the page you&#39;re looking for.
                                <br>
                                <a href="/" class="link">Home page</a>.
                            </p>
                        </div>
                    </div>
                </div>
                
                <script src="/libs/jquery/jquery.min.js?v=636175753388689445" type="text/javascript"></script>
                <script src="/libs/bootstrap/js/bootstrap.min.js?v=636175753352659830" type="text/javascript"></script>
                <script src="/libs/jquery-blockui/jquery.blockui.min.js?v=636175753389339473" type="text/javascript"></script>
                <script src="/libs/jquery-uniform/jquery.uniform.min.js?v=636175753423909460" type="text/javascript"></script>
                <script src="/libs/jquery-cookie/jquery.cookie.min.js?v=636175753389519557" type="text/javascript"></script>
                <script type="text/javascript">
    abp.localization.defaultSourceName = 'AppConnect';
  </script>
                
                <script src="/AbpScripts/GetScripts?v=636190858995785233" type="text/javascript"></script>
                <script src="/libs/jquery-validation/js/jquery.validate.min.js?v=636175753426729463" type="text/javascript"></script>
                <script src="/libs/jquery-validation/js/localization/_messages_empty.js?v=636175753445940001" type="text/javascript"></script>
                <script src="/metronic/assets/global/scripts/app.js?v=636175753556739463" type="text/javascript"></script>
                <script type="text/javascript">
    App.setAssetsPath(abp.appPath + 'metronic/assets/');
  </script>
                <script src="/Common/Scripts/appUserNotificationHelper.js"></script>
                <script src="/Common/Scripts/consts.js"></script>
                <script src="/Common/Scripts/helpers.js"></script>
                <script src="/Common/Scripts/jquery-custom.js"></script>
                <script src="/Common/Scripts/jquery-validation-custom.js"></script>
                <script src="/Common/Scripts/librarySettings.js"></script>
                <script src="/Common/Scripts/ModalManager.js"></script>
                <script src="/Common/Scripts/passwordComplexityHelper.js"></script>
                <script src="/Common/Scripts/utils.js"></script>
                <script src="/Common/Scripts/Chat/chat.js"></script>
                <script src="/Common/Scripts/Chat/chat.signalr.js"></script>
                <script src="/Common/Scripts/LocalStorage/localStorage.js"></script>
                <script src="/Common/Scripts/LocalStorage/localStorage.localForage.js"></script>
                <script src="/metronic/assets/admin/layout/scripts/layout.js?v=636175753494969559" type="text/javascript"></script>
                <script>
    jQuery(document).ready(function () {
      if (CurrentPage) {
        CurrentPage.init();
      }
    });
  </script>
                
                <script type="application/json" id="__browserLink_initializationData">
    {"appName":"Chrome","requestId":"c80ccfa8caaf49bd9489d156587d9201"}
</script>
                <script type="text/javascript" src="http://localhost:1853/fc4f53901f894a9daa652325c09bfb01/browserLink" async="async"></script>
                


            </body>
        </html>

do i have to enable JWT Token based Authentication, according to the following documentation i have everything setup fine

<a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide-Core#authentication">https://aspnetzero.com/Documents/Develo ... entication</a>


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think you are not using ASP.NET Core version, if so, you should look at this document <a class="postlink" href="https://aspnetzero.com/Documents/Development-Guide#token-based-authentication">https://aspnetzero.com/Documents/Develo ... entication</a>.