This file contains hidden or 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
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <OutputType>Exe</OutputType> | |
| <TargetFramework>net6.0</TargetFramework> | |
| <ImplicitUsings>enable</ImplicitUsings> | |
| <Nullable>enable</Nullable> | |
| <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> | |
| </PropertyGroup> |
This file contains hidden or 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
| # pull official base image | |
| FROM node:16.9.1-alpine3.14 | |
| # set working directory | |
| WORKDIR /reactapp | |
| # install app dependencies | |
| COPY package.json ./ | |
| COPY package-lock.json ./ | |
| RUN npm install --silent |
This file contains hidden or 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
| # Items that don't need to be in a Docker image. | |
| # Anything not used by the build system should go here. | |
| Dockerfile | |
| .dockerignore | |
| .gitignore | |
| README.md | |
| # Artifacts that will be built during image creation. | |
| # This should contain all files created during `npm run build`. | |
| build |
This file contains hidden or 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
| using Microsoft.IdentityModel.Tokens; | |
| using System; | |
| using System.Security.Cryptography; | |
| namespace Cryptography | |
| { | |
| internal class Program | |
| { | |
| static void Main(string[] args) | |
| { |
This file contains hidden or 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
| using Microsoft.IdentityModel.Tokens; | |
| using System; | |
| using System.Security.Cryptography; | |
| namespace Cryptography | |
| { | |
| public static class JwsWithRS256 | |
| { | |
| /// <summary> | |
| /// To validate the JWS signature |
This file contains hidden or 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
| /* | |
| * Copyright 2016 Red Hat, Inc. and/or its affiliates | |
| * and other contributors as indicated by the @author tags. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * |
This file contains hidden or 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
| using Microsoft.AspNetCore.Authentication.JwtBearer; | |
| using Microsoft.AspNetCore.Builder; | |
| using Microsoft.AspNetCore.Hosting; | |
| using Microsoft.AspNetCore.HttpsPolicy; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Microsoft.Extensions.Configuration; | |
| using Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Hosting; | |
| using Microsoft.Extensions.Logging; | |
| using Microsoft.OpenApi.Models; |
This file contains hidden or 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
| import React from "react"; | |
| import logo from "./logo.svg"; | |
| import "./App.css"; | |
| import KeyCloakService from "./security/KeyCloakService"; | |
| import HttpService from "./services/HttpServices"; | |
| function logout() { | |
| KeyCloakService.CallLogout(); | |
| } |
This file contains hidden or 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
| import React from "react"; | |
| import ReactDOM from "react-dom/client"; | |
| import "./index.css"; | |
| import App from "./App"; | |
| import reportWebVitals from "./reportWebVitals"; | |
| import KeyCloakService from "./security/KeyCloakService"; | |
| import HttpService from "./services/HttpServices"; | |
| const root = ReactDOM.createRoot( | |
| document.getElementById("root") as HTMLElement |
This file contains hidden or 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
| import Keycloak from "keycloak-js"; | |
| const keycloakInstance = new Keycloak(); | |
| /** | |
| * Initializes Keycloak instance and calls the provided callback function if successfully authenticated. | |
| * | |
| * @param onAuthenticatedCallback | |
| */ | |
| const Login = (onAuthenticatedCallback: Function) => { |
NewerOlder