-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can not login using Swagger #3658
Comments
Does the request header contain "Authorization: Bearer xyz"? |
as you can see it is like this curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-XSRF-TOKEN: nZA_eRB5T4OU6uNbzNmRY6cgoExHFbygioA5enbakT4YY2GcJHmACcuqEwmSGCdF6311dAwSMqBCNEKfnuMUKT3nMsQl_RBKgbsSGVtnHOs1' -d '{ \ "tenancyName": "", \ "usernameOrEmailAddress": "admin", \ "password": "123qwe" \ }' 'http://localhost:61814/api/Account' i dont see Authorization: Bearer xyz how can I add it? |
You can try the approach mentioned in #3653 (comment) |
There's no "login from Swagger". It just calls an endpoint. |
@acjh
I follwed the steps in swagger integration but it seems the is something wrong ... see images |
@sajasbana |
@maliming it will be helpful if swagger works in mvc mpa template also and be able to add Authorization header |
That's Postman... |
@acjh |
var authToken = '';
var bearerAuth = new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + authToken, 'header');
swaggerUi.api.clientAuthorizations.add('bearerAuth', bearerAuth); |
@acjh |
Copy and paste from the value of |
Dear @acjh another test |
Clear your cookies. |
@acjh now is there way to fill header 'Authorization: Bearer xxx' value dynamicly? |
@acjh
please add to template for other users |
Didn't notice that you were referring to module-zero-template
|
@ryancyq |
Dears
Iam using abp mvc with multi pages template, I update solution from nuget package,
everything in application is working only small issue when try swagger
-if try login from swaggerit show success login like this,
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'X-XSRF-TOKEN: nZA_eRB5T4OU6uNbzNmRY6cgoExHFbygioA5enbakT4YY2GcJHmACcuqEwmSGCdF6311dAwSMqBCNEKfnuMUKT3nMsQl_RBKgbsSGVtnHOs1' -d '{ \ "tenancyName": "", \ "usernameOrEmailAddress": "admin", \ "password": "123qwe" \ }' 'http://localhost:61814/api/Account'
{ "result": "LJZqORn3tTCF-t29W6wK5JNodT5G0pzKW8V6ylf8DKjTrlcXKMiwXfnbGEhhcjsyu4KfDtWww0GGEwsHAuU3siYvmYmjZgV0b_2YT70wPG4JK-fkkvk3LU9525u96W2H5gWm2JwiD0olOVUgsY56fZMwoS_TGE1WFfJOPK2YHF1_Xe8Fdti6Xy4rlKPJLS6q9vbbgEuteyt35yRZ_NlFz8R_lyp9Y4hgc0WYul7xn8SAtO33A-wqXSMqUuFAKIBCksy55pOqZOiqB9MyY6eNz_BUlFfLEgwzQ9wTgqT8xqbpxPj7ZI1bbL-iJzMmhfMlHqA4lBdbHWJuRlVYIJMxWK1RlZ1bvPfSdaKn2jyoEWXKThIScEdstsozwiDYiXr1EBkBm61nRvvGKxUC4PEVOfG7E4hRHjWf-0MR8hFo54zuJ1hWdzNenGpz36k_7JWsbL7Dl6cZLNdkhXVmiANkdA7YHEKsDZyUDM4P9lUMV4w", "targetUrl": null, "success": true, "error": null, "unAuthorizedRequest": false, "__abp": true }
but when try see from session api the current login user it shows null in tenant and userId
like this
{ "result": { "user": null, "tenant": null }, "targetUrl": null, "success": true, "error": null, "unAuthorizedRequest": false, "__abp": true }
Please help in this issue
The text was updated successfully, but these errors were encountered: