How to localize Gitkit login button & login page - google-identity-toolkit

The sample code below is for the old V1 version only. Is there any new solution recommended? Thanks.
google.load('identitytoolkit', '0.1', {packages: ['ac'], language: 'fr'});

for the latest v3 identity toolkit client, the above code will not work. Internationalization and localization for v3 will be available in the very near future.

Related

.net core angular spa templates with IdentityServer

I'm using this template: SPA Template
And I want to understand how I can change layout of user registration and user login ?
Thanks and Regards,
Danijel
Oh, It took me 2 days to find out how!
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.1&tabs=netcore-cli
In short - you need to run something like :
dotnet aspnet-codegenerator identity --useDefaultUI
That will generate all .cshtml files. From that you could unleash your html&css skills :)

Xamarin.forms and Azure AD B2C - missing PublicClientApplication.PlatformParameters?

I've been following along with Mayur Tendulkar's blog post: Authenticate Mobile Apps Using Microsoft Authentication Library, but it seems like the article may be out of date with the current version of the library. (Latest version of Microsoft.Identity.Client seems to be 1.1.0-preview.
The code in the sample refers to an IPlatformParameters interface, and a property of PublicClientApplication, PlatformParameters.
Neither of which seem to be present in this library.
This has changed since the last updates. follow this link.
MSAL, this has been replaced with "UIParent". hope this helps

Combining RTCMultiConnection v3 and meteor

How do I get the new v3 of https://github.com/muaz-khan/RTCMultiConnection to work with Meteor. It seems to need Socket.io....
I had v2 working by trading the session ids through the server myself, is that possible again to keep my code?
You can run v3 on a separate port 9001 or similar; and your meteor application (or PHP/ASPX pages) can use/access that port internally. E.g.
// in your meteor page or PHP page
connection.socketURL = 'https://yourdomain.com:9001/';
Now you can take any HTML demo or code from v3 and it will work in your meteor application.
v3 also supports Firebase/PubNub however socket.io is preferred.

Swagger w/ ASP.NET v5 Azure Api App

I'm attempting to set up a Api App (Azure) with Swagger + Swashbuckle as demonstrated by Scott Hanselman at the //Build conference here: http://channel9.msdn.com/Events/Build/2015/2-628.
I have installed (using NuGet) the packages Swagger.Api and Swashbuckle.Core. It hasn't added any controller or settings that I would expect in order to have a swagger page. When I navigate to {baseUrl}\swagger, I get a 404 error.
I would think that since it has a UI it would require a Web App in addition to the Api App, but I've rewatched the demo and Scott clearly says you can add Swagger + Swashbuckle to any Api App. In a 2nd app though I'd think there may be issues with Api discovery. Has anyone set this up yet successfully?
Time rolls on and now Swashbuckle works for vNext (beta8 for me, probably other versions too) - thank you to the team and contributors!
In project.json add the package:
"Swashbuckle": "6.0.0-*",
In startup.cs in ConfigureServices():
services.AddSwaggerGen();
services.ConfigureSwaggerDocument(options =>
{
options.SingleApiVersion(new Info
{
Version = "v1",
Title = "My Super API",
Description = "A Super API using Swagger and Swashbuckle",
TermsOfService = ""
});
});
services.ConfigureSwaggerSchema(options =>{
options.DescribeAllEnumsAsStrings = true;
});
In startup.cs in Configure():
app.UseSwaggerGen();
app.UseSwaggerUi();
Now you can access your API doco - http://domain:port/swagger/ui/index.html
Access your Swagger definition - http://domain:port/swagger/v1/swagger.json
Then assuming you have at least one internet facing dev/uat/staging/prod environment, grab the definition URL then do File-> Import URI at http://editor.swagger.io/ - now you have code-gen for about 20 clients too :)
You can also setup your own code-gen server if you are so inclined too (https://github.com/swagger-api/swagger-codegen), however I leveraged the existing online generator. The online editor also has full model and relationship definitions too at least in my case where I fully defined my model using EF7 (I know, ick... but it's much better than <= EF6 and ServiceStack doesn't support CoreCLR, yet). Depending on the size of your project this could save you a few hours to a few weeks of work documenting, plus it is dynamically updating itself as you code more. And you can use it to test your endpoints too, but I still prefer PostMan.
Full sample project at https://github.com/mrsheepuk/ASPNETSelfCreatedTokenAuthExample/tree/beta8
Big ups to MrSheepUK
HTH
This answer is now outdated. See the other answer.
There is a nice blogpost describing the problem you have: https://alexanderzeitler.com/articles/Deploying-a-ASP-NET-MVC-6-API-as-Azure-API-App-in-Azure-App-Services/
This describes how you can add the Ahoy! package to an ASP.NET v6 Web Api project and adding this as an API app to Azure.
Here is another source: http://devmeetsbi.ghost.io/help-and-test-page-for-asp-net-web-api-asp-net-5-and-mvc-6/
You did all the right steps, but unfortunately for ASP.NET 5, Swashbuckle doesn't work yet.
You can get Ahoy! which is the next version of Swashbuckle that has ASP.NET v6 support here. That should make everything work.

Switching Facebook API from v 5 to v 6

I have this code that was using Facebook C# API v5 and was running on a AJAX call to figure out if user is authenticated:
// Make sure user is logged into Facebook and authroized this application
if (!FacebookWebContext.Current.IsAuthenticated() ||
!FacebookWebContext.Current.IsAuthorized(new[] { "email" }))
{
result.ResultCode = BasicResultCode.NotAuthorized;
return result;
}
var fbuid = FacebookWebContext.Current.UserId;
In v6, Facebook.Web namespace doesn't exist and FacebookWebContext is nowhere to be found. What do I use instead for the above code?
I'm not sure if this will help you or not, but as far as I understand, Facebook removed these features from the c# sdk because they wanted to change the structure of some Facebook cookies. By removing FacebookWebContext they/you don't risk running into issues where the cookie structure might have changed and things are no longer compatible.
Instead, I think you should try to do your authentication through the Facebook Javascript SDK
Try using
FB.getLoginStatus and/or
FB.getAuthResponse
The FacebookWebContext is no longer available. This was already marked in version 5 has deprecated. Check your warning screen in Visual Studio when you do a Rebuild All on your solution.
Now you have to use FacebookClient() from the Facebook namespace.
You then have to check for a FacebookOAuthException that can have multiple results. You can find the documentation of the FacebookOAuthException on https://developers.facebook.com

Resources