Wednesday, February 17, 2021

How to connect to Mongo Atlas from Robo 3T

If you use a local instance of MongoDB, you might be a great fan of Robo3T. However, if you are using Mongo Atlas, the Atlas web interface provides everything you need to manage the database.

If you want to continue your love with Robo3T, below are the detailed steps you need to follow:

  • From the Atlas web dashboard, go to the Clusters tab. Click on the cluster and get the primary and secondary node address Ex: <<>>. mongodb.net:27017
  • From the Clusters tab, click connect, select connect with mongo shell. Select the option “I don’t have mongo shell installed” and select version 3.4. From the connection set, find a replica set. <<>>net:27017/myFirstDatabase?replicaSet=atlas-vdequy-shard-0
  •  Create a new connection. Type -> Replica set



    • Name -> name of your choice
    • Members -> cluster address from step #1
    • Set Name -> replica set from step #2
  •   Authentication tab, add user name and password.
  •  Go to the TLS tab and select the option “Self Signed Certificate.”
  •   Test your connection and save.

Thursday, February 20, 2020

Azure B2C Custom Attributes


Azure B2C Custom Attributes


Azure B2C provides a set of built in user claims. As an example Given Name, Sur Name. However, every customer facing application has some unique requirements to collect additional attributes. As an example – collect business address.
Azure B2C provides an option to create custom attribute and the steps are defined here (https://docs.microsoft.com/en-us/azure/active-directory-b2c/user-flow-custom-attributes)

Example:

Once these custom attributes are defined, it will be available as part of Azure b2C user journeys (built in or custom) or it can be accessed (add, update) using Graph API.
However, Microsoft documentation on Graph API usage for custom attribute is not that clear.

Before explaining the Graph API approach for accessing custom attribute, let us look at how Azure B2C interacts with Azure Active directory to manage user data.

When an Azure AD B2C tenant is created, it creates a default application b2c-extension-app. This application can be found under the blade –> Azure AD B2C  -> App registration (Preview)


Azure B2C use the naming convention extension_<<this application id without dashes>>_custom attribute name to store the custom attributes.
Ex: extension_123456789107899533_BusinessName

To retrieve data using graph API, the following steps needs to be done:

Create an application that has access to Graph API or legacy AAD API.

For this navigate to Azure AD B2C -> App Registration Preview -> New Registration

 Provide API permission for Graph or legacy Azure AD API

  1.  Select the app created at the previous step.
  2.  Go to API permissions tab
  3. Select Add API permission. From Microsoft API, select Graph or Azure Active Directory Graph
  4. Add application permission. Select Directory. Based on the application requirement (read or write access), select the permission.
  5. Once permission is added, provide admin consent. Select the button “Grant Admin permission for <<your AAD name>>
  6.        Based on the API selected – Graph or legacy AAD, use the token end point to get an access token. Use content type - application/x-www-form-urlencoded

Graph:



AAD token end point

Get or update user data




Please note to send the token as part of Authorization header

Thursday, August 8, 2019

More love towards Linux

My journey towards AZ solution architect needs more hands own with Linux. So, today (still on PTO and recovering from a medical procedure) I decided to find my old HP Envy 2008, the one which I had abandoned and install Linux - Ubuntu Desktop version.

The process took me an hour:
1. downloaded Ubuntu iso image
2. decided  to burn the image to a CD. If you would like to flash to a USB drive, there are a lot of applications available (https://unetbootin.github.io/)
3. Updated BIOS settings to load from the internal CD drive.

Tuesday, August 6, 2019

Fun time with Linux

After suffering a lot of chronic sinus issues, I had decided to do a sinus endoscopic procedure. After that I took a few days off from wok. Apart from fun times with my kids, I felt a little bored and started to play around with Linux as my first step towards AZ SA certification.

As the first step, I tried to install Centos on my laptop using Virtual box. Since its a new machine, I haven't installed Linux distro and planning to do that for the last few months.

When I opened virtual box, the 64 bit variant is missing and the below two steps bring back the 64 bit option.

1. enable Virtualization from the BIOS (based on the laptop model - for HP spectra series use esc key and F10.)
2. Turn off hyper V feature from windows features (turn windows features on or off)

More details can be found here - http://www.fixedbyvonnie.com/2014/11/virtualbox-showing-32-bit-guest-versions-64-bit-host-os/#.XUmqVvZFzOZ

Wednesday, July 31, 2019

Adding certificate permission for app pool

Go to mmc, select local computer and add certificate snap-in. 



From the personal store, select the certificate, right click → Tasks → Manage Private Keys and add permission to IIS_IUSRS and IIS AppPool\app pool name

Thursday, January 17, 2019

HATEOAS provider for ASP.NET Core



When comes to API maturity model there are two major models:

1. Richardson Maturity Model

2. Amundsen Maturity Model.


To attain RMM 3.0, an API defines resources, respect HTTP protocol and provide self discover able links to  other resources.


To attain AMM 3.0, the APIs are focused on the actions the API affords and consumers can take.


So, to reach maturity level 3, the API or resource MUST provide an action or a list of  actions a client can identify on that API at the run time. This translates to HATEOAS.


While doing some research on Hypermedia As The Engine Of Application State(HATEOAS), I came across some great HATEOAS providers for ASP.NET Core, but they didn't quite fit my need, so I created my own one.


You can read more details from my github page 


- https://github.com/ajopjo/AspNetCore.HypermediaLinks

Monday, November 5, 2018

Headless CMS .NET Core


Inspired from Soctt Hanselman blog:

Most of the traditional CMS systems are monolithic, UI, back end systems, admin tools..etc. Since the world is rallying towards REST, headless CMS systems are becoming popular (integrate content via APIs).

A Headless CMS is a back-end only content management system (CMS) built from the ground up as a content repository that makes content accessible via a RESTful API for display on any device.

So, if you are doing some projects using ASP.NET Core, the below are the few headless CMS frameworks:


Featured post

How to connect to Mongo Atlas from Robo 3T

If you use a local instance of MongoDB, you might be a great fan of Robo3T. However, if you are using Mongo Atlas, the Atlas web interface p...

Popular Posts