#1. Using Proxy
Add a file proxy.conf.json
{
The most common technology presented which .NET people looking for. Its gonna be your turn now.
#1. Using Proxy
Add a file proxy.conf.json
{
$os = [System.Environment]::OSVersion.Platform
$runningLinux = $false
$Host.UI.WriteLine("Running on $os")
if("Unix" -eq $os)
{
$runningLinux = $true
}
az login --service-principal -u <principle-guid> -p <active-secret> --tenant <token-guid>
$Host.UI.WriteLine("Login was successful for az cli and now going to get the token from https://vault.azure.net")
$token=az account get-access-token --resource https://vault.azure.net --query accessToken -o tsv
$Host.UI.WriteLine("Received token successful $token")
# Define headers properly (PowerShell expects a hash table)
$headers = @{
"Authorization" = "Bearer $token"
}
$Host.UI.WriteLine("Start calling nslook on kvdmpprodae001.vault.azure.net")
if(!$runningLinux)
{
Resolve-DnsName kvdmpprodae001.vault.azure.net
} else
{
nslookup kvdmpprodae001.vault.azure.net
}
$Host.UI.WriteLine("End calling nslook on kvdmpprodae001.vault.azure.net")
$Host.UI.WriteLine("Start calling curl on https://kvdmpprodae001.vault.azure.net")
curl -v https://kvdmpprodae001.vault.azure.net
$Host.UI.WriteLine("End calling curl on https://kvdmpprodae001.vault.azure.net")
if($runningLinux)
{
$Host.UI.WriteLine("Start calling curl on https://kvdmpprodae001.vault.azure.net/secrets/<your-key-name>?api-version=7.3")
curl -v -H "Authorization: Bearer $token" --trace-ascii trace.log https://kvdmpprodae001.vault.azure.net/secrets/<your-key-name>?api-version=7.3
$Host.UI.WriteLine("End calling curl on https://kvdmpprodae001.vault.azure.net/secrets/<your-key-name>?api-version=7.3")
}
# Call Key Vault REST API
$Host.UI.WriteLine("Invoking the webrequest with the token received")
$response = Invoke-WebRequest -Uri "https://kvdmpprodae001.vault.azure.net/secrets/<your-key-name>?api-version=7.3" -Headers $headers
$Host.UI.WriteLine("Now printing the vault access")
# Output response
$response.Content
A JWT has 3 parts (Base64URL encoded, separated by dots):
<header>.<payload>.<signature>
Create a POSTMan POST request to get MS token:
POST https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token
Send the below params in x-www.-form-urlencoded:
client_id: <id of application>client_secret: <generated secret of that app>score: api://<tenant-id>/.defaultgrant_type : client_credentials
The response would be :
{ "token_type": "Bearer", "expires_in": 3599, "ext_expires_in": 3599, "access_token": "eyJ0eXAiOiJKV1QiL................."}
Copy that access_token and get ready for actual API request:
https://<applicationurl>/<apiname>/<operationname>
For exhttps://tap/tcaservice/myapi
Send that access token as Bearer Token under Authentication Header
Here is the code for Token validation
@Componentpublic class MicrosoftTokenFilter extends OncePerRequestFilter {
private final JwtDecoder jwtDecoder;
public MicrosoftTokenFilter(@Value("${azure.ad.tenant-id}") String tenantId) { //String issuerUri = "https://login.microsoftonline.com/" + tenantId + "/v2.0"; String issuerUri = "https://sts.windows.net/" + tenantId + "/"; this.jwtDecoder = JwtDecoders.fromIssuerLocation(issuerUri); }
@Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
logger.info("Starting MicrosoftTokenFilter"); String authHeader = request.getHeader("Authorization"); if (authHeader != null && authHeader.startsWith("Bearer ")) { String token = authHeader.substring(7);
logger.info(" token = " + token); try { Jwt jwt = jwtDecoder.decode(token);
SetupAuthentication(jwt);
} catch (Exception e) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Invalid Microsoft token"); return; } }
filterChain.doFilter(request, response); }
private void SetupAuthentication(Jwt jwt) {
Map<String, Object> claims = jwt.getClaims();
String name = ""; String email = ""; String orgCode = ""; boolean isAuthUser = false; String environment = "TEST"; String orgName = "";
List<Role> roles = new ArrayList<Role>(); for ( Map.Entry<String,Object> claim : claims.entrySet()) {
if (claim.getKey().equals("EMAIL")) { email = claim.getValue().toString(); } }
//set faked name = "Naas api"; email = "vkumar@austroads.gov.au"; orgCode = "Naas"; isAuthUser = true; environment = "TEST"; orgName = "Austroads";
if (isAuthUser) { User user = new User(); user.setFirstName(""); user.setLastName(name); user.setEmail(email); user.setOrganisationCode(orgCode); user.setRoles(roles); user.setOrganisationName(orgName);
Authentication authentication = createAuthentication(jwt, user, environment); setAuthentication(authentication);
logger.info("Authorities set in context:" + SecurityContextHolder.getContext().getAuthentication().getAuthorities());
} }
private Authentication createAuthentication(Jwt jwt, User user, String environment) { List authList = new ArrayList(); authList.add(new SimpleGrantedAuthority("TEST_MyAdminRole"); JwtAuthenticationToken usertoken = new JwtAuthenticationToken(jwt, authList); return usertoken; }
private void setAuthentication(Authentication authentication) { SecurityContext context = SecurityContextHolder.createEmptyContext(); context.setAuthentication(authentication); SecurityContextHolder.setContext(context); }
}
API: Application Programming Interface.
The API Gateway pattern is a design pattern used in distributed systems, especially in microservices architecture, to provide a single-entry point for all client requests. Instead of clients calling each microservice directly, they send requests to the API Gateway, which then routes, transforms, secures, and aggregates responses from backend services.

Azure API Management (APIM) – what you’re learning now.
AWS API Gateway
Kong, Apigee, NGINX, Tyk, Traefik, Spring Cloud Gateway
Core Functions of an API Gateway:
Core Features of APIM:
In visual studio 2022, you can add emojis like checkmark, smile and others in the code or logs to spruce up your logs or comments.
Shortcut Windows + ;
Search and chose name .
For example 0 fire, checkmark
| Type | Common Use Case | Token Type / Auth Flow |
|---|---|---|
| ✅ JWT Bearer Token | APIs, SPAs, Mobile Apps | Token-based (Stateless) |
| ✅ Cookie Authentication | Web Apps (MVC / Razor Pages) | Cookie-based (Stateful) |
| ✅ OAuth2 / OpenID Connect | Social Login, Enterprise SSO | External Identity Providers |
| ✅ API Key Auth | Simple Public APIs | Key in Header/Query |
| ✅ Windows Authentication | Intranet apps, Enterprise networks (AD/LDAP) | Windows/Kerberos |
| ✅ Certificate Authentication | High-security APIs (B2B) | X.509 client certs |
| ✅ Custom Token / HMAC | Legacy systems, Highly controlled environments | Custom logic |
In the google sheets, use the following script and enjoy the function to count the colored cells
=countColoredCells(B59:AF59, "#274e13") #Green color code
function countColoredCells(countRange,colorRef) {
1. First install Nodejs from nodejs.org
2. Download and Install VSCode
3. After installing nodejs, set path environment
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ npm
+ ~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
6. Run the following command:
Set-ExecutionPolicy RemoteSigned
7. Install Angular CLI using
npm install -g @angular/cli
8. ng new mydental
9. cd mydenal
10. ng serve mydental
11. For better UI, lets add Angular Materialng add @angular/material
12. Create your first component
ng generate component dashboard
Learning to create AI Agents is a fascinating journey that combines elements of programming, machine learning, and problem-solving. Here's a breakdown of how you can embark on this learning process: