Google token validation with local authentication
See original GitHub issueHey
First of all I should mention that you’re library is very good and makes it easier to validate Google token. As I am new to .net core
a question raised in my mind.
I am currently having a .net core
React application that is configured with local authentication with JWT.
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options => {
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidateAudience = true,
ValidateLifetime = true,
ValidateIssuerSigningKey = true,
ValidIssuer = "yourdomain.com",
ValidAudience = "yourdomain.com",
IssuerSigningKey = new SymmetricSecurityKey(
Encoding.UTF8.GetBytes("secret key"))
};
});
Now I want to add Google token validation and I was wondering to ask, will I be able to use your NuGet package and have my local authentication flow?
If I can would that be something like this?
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options => {
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true,
ValidateAudience = true,
ValidateLifetime = true,
ValidateIssuerSigningKey = true,
ValidIssuer = "yourdomain.com",
ValidAudience = "yourdomain.com",
IssuerSigningKey = new SymmetricSecurityKey(
Encoding.UTF8.GetBytes("secret key"))
};
})
.AddJwtBearer(x => x.UseGoogle(
clientId: "<google-client-id>",
hostedDomain: "<optional-g-suite-domain>"));
Cheers
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Authenticate with a backend server
An easy way to validate an ID token signature for debugging is to use the tokeninfo endpoint. Calling this endpoint involves an additional ......
Read more >How can I verify a Google authentication API access token?
Verify that the ID token is a JWT which is properly signed with an appropriate Google public key. · Verify that the value...
Read more >Using Google ID tokens to authenticate users
Using Google ID tokens to authenticate users ... This page describes how to support user authentication in Cloud Endpoints. To authenticate a user,...
Read more >Verify ID Tokens | Firebase Authentication - Google
The Firebase Admin SDK has a built-in method for verifying and decoding ID tokens. If the provided ID token has the correct format,...
Read more >How to use One-tap Google sign in, including ... - YouTube
You also learn how to pass the token to backend #expressjs application and validate that idTtoken for authentication.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @javahemans and @nazarkryp! Did you get anywhere with this? Can I close the issue?
yup, got it working