| @@ -0,0 +1,17 @@ | |||
| using IdentityProvider.Services; | |||
| var builder = WebApplication.CreateBuilder(args); | |||
| // Additional configuration is required to successfully run gRPC on macOS. | |||
| // For instructions on how to configure Kestrel and gRPC clients on macOS, visit https://go.microsoft.com/fwlink/?linkid=2099682 | |||
| // Add services to the container. | |||
| builder.Services.AddGrpc(); | |||
| var app = builder.Build(); | |||
| // Configure the HTTP request pipeline. | |||
| app.MapGrpcService<GreeterService>(); | |||
| app.MapGet("/", () => "Communication with gRPC endpoints must be made through a gRPC client. To learn how to create a client, visit: https://go.microsoft.com/fwlink/?linkid=2086909"); | |||
| app.Run(); | |||
| @@ -0,0 +1,13 @@ | |||
| { | |||
| "profiles": { | |||
| "IdentityProvider": { | |||
| "commandName": "Project", | |||
| "dotnetRunMessages": true, | |||
| "launchBrowser": false, | |||
| "applicationUrl": "http://localhost:5164;https://localhost:7164", | |||
| "environmentVariables": { | |||
| "ASPNETCORE_ENVIRONMENT": "Development" | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,21 @@ | |||
| syntax = "proto3"; | |||
| option csharp_namespace = "IdentityProvider"; | |||
| package greet; | |||
| // The greeting service definition. | |||
| service Greeter { | |||
| // Sends a greeting | |||
| rpc SayHello (HelloRequest) returns (HelloReply); | |||
| } | |||
| // The request message containing the user's name. | |||
| message HelloRequest { | |||
| string name = 1; | |||
| } | |||
| // The response message containing the greetings. | |||
| message HelloReply { | |||
| string message = 1; | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| using Grpc.Core; | |||
| using IdentityProvider; | |||
| namespace IdentityProvider.Services | |||
| { | |||
| public class GreeterService : Greeter.GreeterBase | |||
| { | |||
| private readonly ILogger<GreeterService> _logger; | |||
| public GreeterService(ILogger<GreeterService> logger) | |||
| { | |||
| _logger = logger; | |||
| } | |||
| public override Task<HelloReply> SayHello(HelloRequest request, ServerCallContext context) | |||
| { | |||
| return Task.FromResult(new HelloReply | |||
| { | |||
| Message = "Hello " + request.Name | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,8 @@ | |||
| { | |||
| "Logging": { | |||
| "LogLevel": { | |||
| "Default": "Information", | |||
| "Microsoft.AspNetCore": "Warning" | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| { | |||
| "Logging": { | |||
| "LogLevel": { | |||
| "Default": "Information", | |||
| "Microsoft.AspNetCore": "Warning" | |||
| } | |||
| }, | |||
| "AllowedHosts": "*", | |||
| "Kestrel": { | |||
| "EndpointDefaults": { | |||
| "Protocols": "Http2" | |||
| } | |||
| } | |||
| } | |||
| @@ -3,14 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00 | |||
| # Visual Studio Version 17 | |||
| VisualStudioVersion = 17.2.32630.192 | |||
| MinimumVisualStudioVersion = 10.0.40219.1 | |||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NemAnCore", "NemAnCore\NemAnCore.csproj", "{74DCDAC5-76D7-4E06-A3F2-DE22CD37FB89}" | |||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NemAnBlazor", "NemAnCore\NemAnBlazor.csproj", "{74DCDAC5-76D7-4E06-A3F2-DE22CD37FB89}" | |||
| EndProject | |||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "gRPCServer", "gRPCServer\gRPCServer.csproj", "{9E8FA4BC-BF52-47E2-8E61-A4151505ED7C}" | |||
| EndProject | |||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthService", "AuthService\AuthService.csproj", "{CB9B1DAB-3F49-4156-8812-203536FE5E54}" | |||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SpotifyService", "gRPCServer\SpotifyService.csproj", "{9E8FA4BC-BF52-47E2-8E61-A4151505ED7C}" | |||
| EndProject | |||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SpotifyWorker", "SpotifyWorker\SpotifyWorker.csproj", "{0CE36C12-E8D7-424A-9161-0A05306CD8BC}" | |||
| EndProject | |||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IdentityProvider", "IdentityProvider\IdentityProvider.csproj", "{D160945A-5068-4D6A-A09D-5DD7A9EFBC01}" | |||
| EndProject | |||
| Global | |||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
| Debug|Any CPU = Debug|Any CPU | |||
| @@ -25,14 +25,14 @@ Global | |||
| {9E8FA4BC-BF52-47E2-8E61-A4151505ED7C}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
| {9E8FA4BC-BF52-47E2-8E61-A4151505ED7C}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
| {9E8FA4BC-BF52-47E2-8E61-A4151505ED7C}.Release|Any CPU.Build.0 = Release|Any CPU | |||
| {CB9B1DAB-3F49-4156-8812-203536FE5E54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
| {CB9B1DAB-3F49-4156-8812-203536FE5E54}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
| {CB9B1DAB-3F49-4156-8812-203536FE5E54}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
| {CB9B1DAB-3F49-4156-8812-203536FE5E54}.Release|Any CPU.Build.0 = Release|Any CPU | |||
| {0CE36C12-E8D7-424A-9161-0A05306CD8BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
| {0CE36C12-E8D7-424A-9161-0A05306CD8BC}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
| {0CE36C12-E8D7-424A-9161-0A05306CD8BC}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
| {0CE36C12-E8D7-424A-9161-0A05306CD8BC}.Release|Any CPU.Build.0 = Release|Any CPU | |||
| {D160945A-5068-4D6A-A09D-5DD7A9EFBC01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||
| {D160945A-5068-4D6A-A09D-5DD7A9EFBC01}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||
| {D160945A-5068-4D6A-A09D-5DD7A9EFBC01}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||
| {D160945A-5068-4D6A-A09D-5DD7A9EFBC01}.Release|Any CPU.Build.0 = Release|Any CPU | |||
| EndGlobalSection | |||
| GlobalSection(SolutionProperties) = preSolution | |||
| HideSolutionNode = FALSE | |||
| @@ -1,9 +1,18 @@ | |||
| @page "/" | |||
| @inject NavigationManager NavigationManager | |||
| <PageTitle>Index</PageTitle> | |||
| <h1>Hello, world!</h1> | |||
| <h1>Pozdrav Diligent!</h1> | |||
| Welcome to your new app. | |||
| Dobrodošli u našu NemAn aplikaciju. | |||
| <SurveyPrompt Title="How is Blazor working for you?" /> | |||
| <button class="btn-outline-success" @onclick="SpotifyRedirect">Spotify</button> | |||
| @code{ | |||
| private void SpotifyRedirect() | |||
| { | |||
| NavigationManager.NavigateTo( | |||
| "https://accounts.spotify.com/en/authorize?client_id=83e1d09876b049c4bb1953185a4b3bfb&redirect_uri=https%3A%2F%2Flocalhost%3A7229%2F&response_type=code&scope=user-read-currently-playing%20user-read-email%20user-library-modify%20user-top-read%0A%0A%0A&show_dialog=true"); | |||
| } | |||
| } | |||
| @@ -1,6 +1,6 @@ | |||
| using Microsoft.AspNetCore.Components.Web; | |||
| using Microsoft.AspNetCore.Components.WebAssembly.Hosting; | |||
| using NemAnCore; | |||
| using NemAnBlazor; | |||
| var builder = WebAssemblyHostBuilder.CreateDefault(args); | |||
| builder.RootComponents.Add<App>("#app"); | |||
| @@ -6,5 +6,5 @@ | |||
| @using Microsoft.AspNetCore.Components.Web.Virtualization | |||
| @using Microsoft.AspNetCore.Components.WebAssembly.Http | |||
| @using Microsoft.JSInterop | |||
| @using NemAnCore | |||
| @using NemAnCore.Shared | |||
| @using NemAnBlazor | |||
| @using NemAnBlazor.Shared | |||
| @@ -0,0 +1,17 @@ | |||
| <Project Sdk="Microsoft.NET.Sdk.Web"> | |||
| <PropertyGroup> | |||
| <TargetFramework>net6.0</TargetFramework> | |||
| <Nullable>enable</Nullable> | |||
| <ImplicitUsings>enable</ImplicitUsings> | |||
| </PropertyGroup> | |||
| <ItemGroup> | |||
| <Protobuf Include="Protos\greet.proto" GrpcServices="Server" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <PackageReference Include="Grpc.AspNetCore" Version="2.40.0" /> | |||
| </ItemGroup> | |||
| </Project> | |||