NET Core JWT - How to handle Validate Authentication in Micro ServiceHow to escape braces (curly brackets) in a format string in .NETHow can I get the application's path in a .NET console application?Best practices for server-side handling of JWT tokensWhat is secret key for JWT based authentication and how to generate it?Is this JWT based authentication method safe?How to properly supply legacy Firebase JWT token as “auth” to the REST API?Implementing JWT authentication in Asp.net WebApi using Microsoft System.IdentityModel.Tokens.JwtJWT authentication for ASP.NET Web APIHow Do I Manually Validate a JWT Asp.Net Core?JWT handling with WSO2-AM

Declining an offer to present a poster instead of a paper

Why is the Turkish president's surname spelt in Russian as Эрдоган, with г?

Why aren't (poly-)cotton tents more popular?

What is this particular type of chord progression, common in classical music, called?

What determines the "strength of impact" of a falling object on the ground, momentum or energy?

Does image quality of the lens affect "focus and recompose" technique?

Do French speakers not use the subjunctive informally?

In the Marvel universe, can a human have a baby with any non-human?

How to perform Login Authentication at the client-side?

"It will become the talk of Paris" - translation into French

Does Hubble need to dump momentum of its reaction wheels?

Are there any vegetarian astronauts?

Does the Paladin's Aura of Protection affect only either her or ONE ally in range?

How well known and how commonly used was Huffman coding in 1979?

Does squid ink pasta bleed?

Counting occurrence of words in table is slow

Is there a short way to compare many values mutually at same time without using multiple 'and's?

Calculating the partial sum of a expl3 sequence

Symbolic equivalent of chmod 400

Should I tell my insurance company I'm making payments on my new car?

Layout of complex table

A player is constantly pestering me about rules, what do I do as a DM?

How should I behave to assure my friends that I am not after their money?

Why isn’t the tax system continuous rather than bracketed?



NET Core JWT - How to handle Validate Authentication in Micro Service


How to escape braces (curly brackets) in a format string in .NETHow can I get the application's path in a .NET console application?Best practices for server-side handling of JWT tokensWhat is secret key for JWT based authentication and how to generate it?Is this JWT based authentication method safe?How to properly supply legacy Firebase JWT token as “auth” to the REST API?Implementing JWT authentication in Asp.net WebApi using Microsoft System.IdentityModel.Tokens.JwtJWT authentication for ASP.NET Web APIHow Do I Manually Validate a JWT Asp.Net Core?JWT handling with WSO2-AM






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















In Startup.cs (NET CORE), I use JWT to create and valid Token.
In now, I need to refresh token and handle it with Blacklist Token.
At login, I created AccessToken & Refresh Token.



I've founded another security solutions here.
https://scotch.io/@sagarsubedi/3-level-jwt-secret-is-this-a-good-idea



Query the database for the user

Validate signature
get the app_secret
get user_secret form the user
using the token_id claim get the token_secret from the token_info of the user.
also validate the exp claim of the token with the one stored
use header, payload and the secrets to recompute the signature.
make sure that signature that came with the token and recomputed signature match.



I'd show my current code in Authorization token.



services.AddAuthentication(options =>



 
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;

)


.AddJwtBearer (configureOptions =>




configureOptions.ClaimsIssuer = jwtAppSettingOptions[nameof(JwtIssuerOptions.Issuer)];



 configureOptions.TokenValidationParameters = tokenValidationParameters;
configureOptions.SaveToken = true;

configureOptions.Events = new JwtBearerEvents

OnAuthenticationFailed = context =>

if (context.Exception.GetType() == typeof(SecurityTokenExpiredException))

context.Response.Headers.Add("Token-Expired", "true");

return Task.CompletedTask;


;
);


I don't know how to handle valid follow solution in Start > ConfigureServices.
I think I need to handle Validate token

because I must Check blacklist in DB before valid token.
(Or do example like another solution)



In current, It's only valid token, but can not check blacklist in DB. Or do anything.



Please help me.










share|improve this question






















  • hi, everybody can understand my question ?

    – Cristen Rafalko
    Mar 26 at 2:03

















0















In Startup.cs (NET CORE), I use JWT to create and valid Token.
In now, I need to refresh token and handle it with Blacklist Token.
At login, I created AccessToken & Refresh Token.



I've founded another security solutions here.
https://scotch.io/@sagarsubedi/3-level-jwt-secret-is-this-a-good-idea



Query the database for the user

Validate signature
get the app_secret
get user_secret form the user
using the token_id claim get the token_secret from the token_info of the user.
also validate the exp claim of the token with the one stored
use header, payload and the secrets to recompute the signature.
make sure that signature that came with the token and recomputed signature match.



I'd show my current code in Authorization token.



services.AddAuthentication(options =>



 
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;

)


.AddJwtBearer (configureOptions =>




configureOptions.ClaimsIssuer = jwtAppSettingOptions[nameof(JwtIssuerOptions.Issuer)];



 configureOptions.TokenValidationParameters = tokenValidationParameters;
configureOptions.SaveToken = true;

configureOptions.Events = new JwtBearerEvents

OnAuthenticationFailed = context =>

if (context.Exception.GetType() == typeof(SecurityTokenExpiredException))

context.Response.Headers.Add("Token-Expired", "true");

return Task.CompletedTask;


;
);


I don't know how to handle valid follow solution in Start > ConfigureServices.
I think I need to handle Validate token

because I must Check blacklist in DB before valid token.
(Or do example like another solution)



In current, It's only valid token, but can not check blacklist in DB. Or do anything.



Please help me.










share|improve this question






















  • hi, everybody can understand my question ?

    – Cristen Rafalko
    Mar 26 at 2:03













0












0








0








In Startup.cs (NET CORE), I use JWT to create and valid Token.
In now, I need to refresh token and handle it with Blacklist Token.
At login, I created AccessToken & Refresh Token.



I've founded another security solutions here.
https://scotch.io/@sagarsubedi/3-level-jwt-secret-is-this-a-good-idea



Query the database for the user

Validate signature
get the app_secret
get user_secret form the user
using the token_id claim get the token_secret from the token_info of the user.
also validate the exp claim of the token with the one stored
use header, payload and the secrets to recompute the signature.
make sure that signature that came with the token and recomputed signature match.



I'd show my current code in Authorization token.



services.AddAuthentication(options =>



 
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;

)


.AddJwtBearer (configureOptions =>




configureOptions.ClaimsIssuer = jwtAppSettingOptions[nameof(JwtIssuerOptions.Issuer)];



 configureOptions.TokenValidationParameters = tokenValidationParameters;
configureOptions.SaveToken = true;

configureOptions.Events = new JwtBearerEvents

OnAuthenticationFailed = context =>

if (context.Exception.GetType() == typeof(SecurityTokenExpiredException))

context.Response.Headers.Add("Token-Expired", "true");

return Task.CompletedTask;


;
);


I don't know how to handle valid follow solution in Start > ConfigureServices.
I think I need to handle Validate token

because I must Check blacklist in DB before valid token.
(Or do example like another solution)



In current, It's only valid token, but can not check blacklist in DB. Or do anything.



Please help me.










share|improve this question














In Startup.cs (NET CORE), I use JWT to create and valid Token.
In now, I need to refresh token and handle it with Blacklist Token.
At login, I created AccessToken & Refresh Token.



I've founded another security solutions here.
https://scotch.io/@sagarsubedi/3-level-jwt-secret-is-this-a-good-idea



Query the database for the user

Validate signature
get the app_secret
get user_secret form the user
using the token_id claim get the token_secret from the token_info of the user.
also validate the exp claim of the token with the one stored
use header, payload and the secrets to recompute the signature.
make sure that signature that came with the token and recomputed signature match.



I'd show my current code in Authorization token.



services.AddAuthentication(options =>



 
options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;

)


.AddJwtBearer (configureOptions =>




configureOptions.ClaimsIssuer = jwtAppSettingOptions[nameof(JwtIssuerOptions.Issuer)];



 configureOptions.TokenValidationParameters = tokenValidationParameters;
configureOptions.SaveToken = true;

configureOptions.Events = new JwtBearerEvents

OnAuthenticationFailed = context =>

if (context.Exception.GetType() == typeof(SecurityTokenExpiredException))

context.Response.Headers.Add("Token-Expired", "true");

return Task.CompletedTask;


;
);


I don't know how to handle valid follow solution in Start > ConfigureServices.
I think I need to handle Validate token

because I must Check blacklist in DB before valid token.
(Or do example like another solution)



In current, It's only valid token, but can not check blacklist in DB. Or do anything.



Please help me.







.net security jwt






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 25 at 11:13









Cristen RafalkoCristen Rafalko

377 bronze badges




377 bronze badges












  • hi, everybody can understand my question ?

    – Cristen Rafalko
    Mar 26 at 2:03

















  • hi, everybody can understand my question ?

    – Cristen Rafalko
    Mar 26 at 2:03
















hi, everybody can understand my question ?

– Cristen Rafalko
Mar 26 at 2:03





hi, everybody can understand my question ?

– Cristen Rafalko
Mar 26 at 2:03












0






active

oldest

votes














Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336520%2fnet-core-jwt-how-to-handle-validate-authentication-in-micro-service%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55336520%2fnet-core-jwt-how-to-handle-validate-authentication-in-micro-service%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현