-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from ksummarized/00016_Implement_OAuth_Google
Closes #16 Implement o auth Google
- Loading branch information
Showing
56 changed files
with
15,317 additions
and
12,224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# PostgreSQL | ||
|
||
# The name of the database user | ||
POSTGRES_USER= | ||
# The password for the database user | ||
POSTGRES_PASSWORD= | ||
|
||
# Keycloak | ||
|
||
# The username of the keycloak admin user | ||
KEYCLOAK_ADMIN= | ||
# The password of the keycloak admin user | ||
KEYCLOAK_ADMIN_PASSWORD= | ||
# If enable the health-check endpoints in the keycloak | ||
KC_HEALTH_ENABLED=true | ||
# The name of the database provider for the keycloak (we are using our PostgreSQL database from the container) | ||
KC_DB=postgres | ||
# The URL connection to the keycloak database | ||
# E.g: jdbc:postgresql://<database_container>:<database_port>/keycloak | ||
KC_DB_URL= | ||
# The name of the user that keycloak will use to connect into the database | ||
KC_DB_USERNAME= | ||
# The password of the user that keycloak will use to connect into the database | ||
KC_DB_PASSWORD= | ||
|
||
# Keycloak app (realm-export.json) | ||
|
||
# The name of the realm in the keycloak that will be used by application | ||
KSUMMARIZED_REALM_NAME=KnowledgeSummarized | ||
# The secret for the `ksummarized` client that is used by frontend application during authentication | ||
KSUMMARIZED_CLIENT_SECRET= | ||
# The private key of the ksummarized realm | ||
KSUMMARIZED_RSA_PRIVATE_KEY= | ||
# The public key of the ksummarized realm | ||
KSUMMARIZED_RSA_PUBLIC_KEY= | ||
# The certificate of the ksummarized realm | ||
KSUMMARIZED_RSA_CERTIFICATE= | ||
# The ClientId for the Google OAuth provider | ||
PROVIDER_GOOGLE_ID= | ||
# The ClientSecret for the Google OAuth provider | ||
PROVIDER_GOOGLE_SECRET= | ||
# The ClientId for the Twitter/X OAuth provider | ||
PROVIDER_TWITTER_X_ID= | ||
# The ClientSecret for the Twitter/X OAuth provider | ||
PROVIDER_TWITTER_X_SECRET= | ||
# The ClientId for the GitHub OAuth provider | ||
PROVIDER_GITHUB_ID= | ||
# The ClientSecret for the GitHub OAuth provider | ||
PROVIDER_GITHUB_SECRET= | ||
# The ClientId for the Facebook OAuth provider | ||
PROVIDER_FACEBOOK_ID= | ||
# The ClientSecret for the Facebook OAuth provider | ||
PROVIDER_FACEBOOK_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -455,3 +455,7 @@ node_modules | |
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Environment files | ||
.env | ||
appsettings.Development.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace api.Constants; | ||
|
||
public static class ErrorMessages | ||
{ | ||
public const string UserAlreadyExists = "User already exists"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using api.Data.DAO; | ||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace api.Data; | ||
|
||
public class ApplicationDbContext : DbContext | ||
{ | ||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) | ||
{ | ||
} | ||
public DbSet<UserModel> Users { get; set; } | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
using Microsoft.AspNetCore.Identity; | ||
using System.ComponentModel.DataAnnotations; | ||
|
||
namespace api.Data.DAO; | ||
|
||
public class UserModel : IdentityUser | ||
public class UserModel | ||
{ | ||
[Key] | ||
public int Id { get; set; } | ||
public required string KeycloakUuid { get; set; } | ||
[EmailAddress] | ||
public required string Email { get; set; } | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace api.Data; | ||
public class KeycloakJwtOptions | ||
{ | ||
public required string Issuer { get; set; } | ||
public required string Audience { get; set; } | ||
public required string Secret { get; set; } | ||
|
||
[SetsRequiredMembers] | ||
public KeycloakJwtOptions(string issuer, string audience, string secret) | ||
{ | ||
Issuer = issuer; | ||
Audience = audience; | ||
Secret = secret; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.