d i f f   - - g i t   a / a p p s / s e r v e r - n e t / s r c / H o s t / P r o g r a m . c s   b / a p p s / s e r v e r - n e t / s r c / H o s t / P r o g r a m . c s 
 
 i n d e x   f 7 e 2 b 2 f . . e 6 9 d e 2 9   1 0 0 6 4 4 
 
 - - -   a / a p p s / s e r v e r - n e t / s r c / H o s t / P r o g r a m . c s 
 
 + + +   b / a p p s / s e r v e r - n e t / s r c / H o s t / P r o g r a m . c s 
 
 @ @   - 1 , 1 7 9   + 0 , 0   @ @ 
 
 - u s i n g   K n o t . S h a r e d . I n f r a s t r u c t u r e ; 
 
 - u s i n g   K n o t . M o d u l e s . I d e n t i t y ; 
 
 - u s i n g   K n o t . M o d u l e s . C h a t s ; 
 
 - u s i n g   K n o t . M o d u l e s . C h a t s . I n f r a s t r u c t u r e . S i g n a l R ; 
 
 - u s i n g   K n o t . M o d u l e s . I d e n t i t y . I n f r a s t r u c t u r e . P e r s i s t e n c e ; 
 
 - u s i n g   K n o t . M o d u l e s . C h a t s . I n f r a s t r u c t u r e . P e r s i s t e n c e ; 
 
 - u s i n g   M i c r o s o f t . E n t i t y F r a m e w o r k C o r e ; 
 
 - u s i n g   M i c r o s o f t . A s p N e t C o r e . A u t h e n t i c a t i o n . J w t B e a r e r ; 
 
 - u s i n g   M i c r o s o f t . I d e n t i t y M o d e l . T o k e n s ; 
 
 - u s i n g   S y s t e m . T e x t ; 
 
 - u s i n g   S y s t e m . I d e n t i t y M o d e l . T o k e n s . J w t ; 
 
 - u s i n g   S y s t e m . T e x t . J s o n ; 
 
 - u s i n g   S y s t e m . T e x t . J s o n . S e r i a l i z a t i o n ; 
 
 - u s i n g   M i c r o s o f t . E x t e n s i o n s . F i l e P r o v i d e r s ; 
 
 - u s i n g   M i c r o s o f t . A s p N e t C o r e . S i g n a l R ; 
 
 - u s i n g   S y s t e m . S e c u r i t y . C l a i m s ; 
 
 - 
 
 - 
 
 - 
 
 - J w t S e c u r i t y T o k e n H a n d l e r . D e f a u l t I n b o u n d C l a i m T y p e M a p . C l e a r ( ) ; 
 
 - 
 
 - v a r   b u i l d e r   =   W e b A p p l i c a t i o n . C r e a t e B u i l d e r ( a r g s ) ; 
 
 - 
 
 - / /   h%0h%a%h%%h%U%d%d%d%h%%d%h%U%d%  h%]%h%[%h%$%d%h%W%h%a%h%c%
 
 - / /   h%,h%%h%%h%%h%U%h%\%h%%  d%d%h%%h%\%h%$%h%%d%d%h%\%d%d%  h%%h%a%d%h%a%h%]%h%a%h%\%h%\%d%d%  h%[%h%Q%d%d%h%b%h%a%h%\%h%U%d%  h%%  h%U%h%a%d%h%%d%d%h%U%d%  . N E T 
 
 - v a r   e n v M a p p i n g s   =   n e w   D i c t i o n a r y < s t r i n g ,   s t r i n g ? > 
 
 - { 
 
 -         [ " C o n n e c t i o n S t r i n g s : D a t a b a s e " ]   =   b u i l d e r . C o n f i g u r a t i o n [ " D A T A B A S E _ U R L " ] , 
 
 -         [ " J w t : S e c r e t " ]   =   b u i l d e r . C o n f i g u r a t i o n [ " J W T _ S E C R E T " ] , 
 
 -         [ " J w t : I s s u e r " ]   =   b u i l d e r . C o n f i g u r a t i o n [ " J W T _ I S S U E R " ] , 
 
 -         [ " J w t : A u d i e n c e " ]   =   b u i l d e r . C o n f i g u r a t i o n [ " J W T _ A U D I E N C E " ] , 
 
 -         [ " W e b R t c : T u r n U r l " ]   =   b u i l d e r . C o n f i g u r a t i o n [ " T U R N _ U R L " ] , 
 
 -         [ " W e b R t c : T u r n U s e r n a m e " ]   =   b u i l d e r . C o n f i g u r a t i o n [ " T U R N _ U S E R N A M E " ] , 
 
 -         [ " W e b R t c : T u r n P a s s w o r d " ]   =   b u i l d e r . C o n f i g u r a t i o n [ " T U R N _ P A S S W O R D " ] 
 
 - } ; 
 
 - 
 
 - / /   h%$h%[%h%%h%%h%%h%W%d%h%a%h%]%  d%h%[%h%W%d%h%Q%h%[%  d%h%a%,   d%d%h%[%  d%h%a%h%%h%W%d%h%\%h%[%  h%V%h%%h%$%h%%h%\%d%  h%%  E N V 
 
 - b u i l d e r . C o n f i g u r a t i o n . A d d I n M e m o r y C o l l e c t i o n ( 
 
 -         e n v M a p p i n g s . W h e r e ( k v   = >   ! s t r i n g . I s N u l l O r E m p t y ( k v . V a l u e ) ) 
 
 -                               . T o D i c t i o n a r y ( k v   = >   k v . K e y ,   k v   = >   k v . V a l u e ) ) ; 
 
 - 
 
 - b u i l d e r . S e r v i c e s . A d d I d e n t i t y M o d u l e ( b u i l d e r . C o n f i g u r a t i o n ) ; 
 
 - b u i l d e r . S e r v i c e s . A d d C h a t s M o d u l e ( b u i l d e r . C o n f i g u r a t i o n ) ; 
 
 - b u i l d e r . S e r v i c e s . A d d S h a r e d I n f r a s t r u c t u r e ( ) ; 
 
 - 
 
 - / /   h%-h%%d%d%d%h%[%h%c%h%Q%h%%  C O R S 
 
 - b u i l d e r . S e r v i c e s . A d d C o r s ( o p t i o n s   = > 
 
 - { 
 
 -         o p t i o n s . A d d D e f a u l t P o l i c y ( p o l i c y   = > 
 
 -         { 
 
 -                 v a r   o r i g i n s F r o m C o n f i g   =   b u i l d e r . C o n f i g u r a t i o n [ " C o r s : O r i g i n s " ] ; 
 
 -                 v a r   d o m a i n   =   b u i l d e r . C o n f i g u r a t i o n [ " D O M A I N " ] ; 
 
 -                 
 
 -                 v a r   o r i g i n s   =   ! s t r i n g . I s N u l l O r E m p t y ( o r i g i n s F r o m C o n f i g )   
 
 -                         ?   o r i g i n s F r o m C o n f i g . S p l i t ( ' , ' )   
 
 -                         :   ( ! s t r i n g . I s N u l l O r E m p t y ( d o m a i n )   ?   n e w [ ]   {   $ " h t t p s : / / { d o m a i n } "   }   :   n e w [ ]   {   " * "   } ) ; 
 
 - 
 
 -                 p o l i c y . W i t h O r i g i n s ( o r i g i n s ) 
 
 -                             . A l l o w A n y H e a d e r ( ) 
 
 -                             . A l l o w A n y M e t h o d ( ) 
 
 -                             . A l l o w C r e d e n t i a l s ( ) ; 
 
 -         } ) ; 
 
 - } ) ; 
 
 - 
 
 - / /   h%-h%%d%d%d%h%[%h%c%h%Q%h%%  S w a g g e r / O p e n A P I 
 
 - b u i l d e r . S e r v i c e s . A d d E n d p o i n t s A p i E x p l o r e r ( ) ; 
 
 - b u i l d e r . S e r v i c e s . A d d S w a g g e r G e n ( ) ; 
 
 - / /   h%-h%%d%d%d%h%[%h%c%h%Q%h%%  h%]%h%%d%d%d%d%d%h%U%h%V%h%%d%h%U%h%U%
 
 - b u i l d e r . S e r v i c e s . A d d R o u t i n g ( o p t i o n s   = >   
 
 - { 
 
 -         o p t i o n s . L o w e r c a s e U r l s   =   t r u e ; 
 
 -         o p t i o n s . L o w e r c a s e Q u e r y S t r i n g s   =   t r u e ; 
 
 - } ) ; 
 
 - 
 
 - 
 
 - b u i l d e r . S e r v i c e s . A d d C o n t r o l l e r s ( ) 
 
 -         . A d d J s o n O p t i o n s ( o p t i o n s   = > 
 
 -         { 
 
 -                 o p t i o n s . J s o n S e r i a l i z e r O p t i o n s . P r o p e r t y N a m i n g P o l i c y   =   J s o n N a m i n g P o l i c y . C a m e l C a s e ; 
 
 -                 o p t i o n s . J s o n S e r i a l i z e r O p t i o n s . C o n v e r t e r s . A d d ( n e w   J s o n S t r i n g E n u m C o n v e r t e r ( ) ) ; 
 
 -         } ) ; 
 
 - 
 
 - b u i l d e r . S e r v i c e s . A d d S i g n a l R ( ) 
 
 -         . A d d J s o n P r o t o c o l ( o p t i o n s   = > 
 
 -         { 
 
 -                 o p t i o n s . P a y l o a d S e r i a l i z e r O p t i o n s . P r o p e r t y N a m i n g P o l i c y   =   J s o n N a m i n g P o l i c y . C a m e l C a s e ; 
 
 -                 o p t i o n s . P a y l o a d S e r i a l i z e r O p t i o n s . C o n v e r t e r s . A d d ( n e w   J s o n S t r i n g E n u m C o n v e r t e r ( ) ) ; 
 
 -         } ) ; 
 
 - 
 
 - b u i l d e r . S e r v i c e s . A d d S i n g l e t o n < I U s e r I d P r o v i d e r ,   C u s t o m U s e r I d P r o v i d e r > ( ) ; 
 
 - 
 
 - / /   h%-h%%d%d%d%h%[%h%c%h%Q%h%%  J W T   h% d%d%h%a%h%\%d%h%U%d%h%U%h%Q%h%%d%h%U%h%U%
 
 - b u i l d e r . S e r v i c e s . A d d A u t h e n t i c a t i o n ( J w t B e a r e r D e f a u l t s . A u t h e n t i c a t i o n S c h e m e ) 
 
 -         . A d d J w t B e a r e r ( o p t i o n s   = > 
 
 -         { 
 
 -                 o p t i o n s . T o k e n V a l i d a t i o n P a r a m e t e r s   =   n e w   T o k e n V a l i d a t i o n P a r a m e t e r s 
 
 -                 { 
 
 -                         V a l i d a t e I s s u e r   =   t r u e , 
 
 -                         V a l i d a t e A u d i e n c e   =   t r u e , 
 
 -                         V a l i d a t e L i f e t i m e   =   t r u e , 
 
 -                         V a l i d a t e I s s u e r S i g n i n g K e y   =   t r u e , 
 
 -                         V a l i d I s s u e r   =   b u i l d e r . C o n f i g u r a t i o n [ " J w t : I s s u e r " ] , 
 
 -                         V a l i d A u d i e n c e   =   b u i l d e r . C o n f i g u r a t i o n [ " J w t : A u d i e n c e " ] , 
 
 -                         I s s u e r S i g n i n g K e y   =   n e w   S y m m e t r i c S e c u r i t y K e y ( 
 
 -                                 E n c o d i n g . U T F 8 . G e t B y t e s ( b u i l d e r . C o n f i g u r a t i o n [ " J w t : S e c r e t " ] ! ) ) 
 
 -                 } ; 
 
 - 
 
 -                 o p t i o n s . E v e n t s   =   n e w   J w t B e a r e r E v e n t s 
 
 -                 { 
 
 -                         O n M e s s a g e R e c e i v e d   =   c o n t e x t   = > 
 
 -                         { 
 
 -                                 v a r   a c c e s s T o k e n   =   c o n t e x t . R e q u e s t . Q u e r y [ " a c c e s s _ t o k e n " ] ; 
 
 -                                 v a r   p a t h   =   c o n t e x t . H t t p C o n t e x t . R e q u e s t . P a t h ; 
 
 -                                 i f   ( ! s t r i n g . I s N u l l O r E m p t y ( a c c e s s T o k e n )   & &   p a t h . S t a r t s W i t h S e g m e n t s ( " / h u b s " ) ) 
 
 -                                 { 
 
 -                                         c o n t e x t . T o k e n   =   a c c e s s T o k e n ; 
 
 -                                 } 
 
 -                                 r e t u r n   T a s k . C o m p l e t e d T a s k ; 
 
 -                         } 
 
 -                 } ; 
 
 -         } ) ; 
 
 - 
 
 - b u i l d e r . S e r v i c e s . A d d A u t h o r i z a t i o n ( ) ; 
 
 - 
 
 - v a r   a p p   =   b u i l d e r . B u i l d ( ) ; 
 
 - 
 
 - / /   h%/d%h%U%h%]%h%a%h%\%d%h%a%h%]%  h%]%h%U%h%%d%h%%d%h%U%h%U%  h%%d%h%U%  d%d%h%%d%d%h%a%
 
 - u s i n g   ( v a r   s c o p e   =   a p p . S e r v i c e s . C r e a t e S c o p e ( ) ) 
 
 - { 
 
 -         v a r   i d e n t i t y D b   =   s c o p e . S e r v i c e P r o v i d e r . G e t R e q u i r e d S e r v i c e < I d e n t i t y D b C o n t e x t > ( ) ; 
 
 -         a w a i t   i d e n t i t y D b . D a t a b a s e . M i g r a t e A s y n c ( ) ; 
 
 - 
 
 -         v a r   c h a t s D b   =   s c o p e . S e r v i c e P r o v i d e r . G e t R e q u i r e d S e r v i c e < C h a t s D b C o n t e x t > ( ) ; 
 
 -         a w a i t   c h a t s D b . D a t a b a s e . M i g r a t e A s y n c ( ) ; 
 
 - } 
 
 - 
 
 - / /   h%-h%%d%d%d%h%[%h%c%h%Q%h%%  h%Q%h%[%h%\%h%%h%a%h%c%h%a%d%h%%  h%V%h%%h%%d%h%[%d%h%[%h%%
 
 - a p p . U s e M i d d l e w a r e < K n o t . S h a r e d . I n f r a s t r u c t u r e . M i d d l e w a r e . E x c e p t i o n H a n d l i n g M i d d l e w a r e > ( ) ; 
 
 - 
 
 - a p p . U s e C o r s ( ) ; 
 
 - 
 
 - i f   ( a p p . E n v i r o n m e n t . I s D e v e l o p m e n t ( ) ) 
 
 - { 
 
 -         a p p . U s e S w a g g e r ( ) ; 
 
 -         a p p . U s e S w a g g e r U I ( ) ; 
 
 - } 
 
 - 
 
 - / /   a p p . U s e H t t p s R e d i r e c t i o n ( ) ; 
 
 - 
 
 - v a r   u p l o a d s P a t h   =   P a t h . C o m b i n e ( D i r e c t o r y . G e t C u r r e n t D i r e c t o r y ( ) ,   " u p l o a d s " ) ; 
 
 - i f   ( ! D i r e c t o r y . E x i s t s ( u p l o a d s P a t h ) ) 
 
 - { 
 
 -         D i r e c t o r y . C r e a t e D i r e c t o r y ( u p l o a d s P a t h ) ; 
 
 - } 
 
 - 
 
 - a p p . U s e S t a t i c F i l e s ( n e w   S t a t i c F i l e O p t i o n s 
 
 - { 
 
 -         F i l e P r o v i d e r   =   n e w   P h y s i c a l F i l e P r o v i d e r ( u p l o a d s P a t h ) , 
 
 -         R e q u e s t P a t h   =   " / u p l o a d s " 
 
 - } ) ; 
 
 - 
 
 - a p p . U s e A u t h e n t i c a t i o n ( ) ; 
 
 - a p p . U s e A u t h o r i z a t i o n ( ) ; 
 
 - 
 
 - / /   h%$h%[%h%%h%%h%%h%W%d%h%a%h%]%  h%Q%h%[%h%\%d%d%h%[%h%W%h%W%h%a%d%d%
 
 - a p p . M a p C o n t r o l l e r s ( ) ; 
 
 - 
 
 - / /   h%$h%[%h%%h%%h%%h%W%d%h%a%h%]%  S i g n a l R   d%h%%h%%d%
 
 - a p p . M a p H u b < C h a t H u b > ( " / h u b s / c h a t " ) ; 
 
 - 
 
 - a p p . R u n ( ) ; 
 
 - 
 
 - p u b l i c   c l a s s   C u s t o m U s e r I d P r o v i d e r   :   I U s e r I d P r o v i d e r 
 
 - { 
 
 -         p u b l i c   s t r i n g ?   G e t U s e r I d ( H u b C o n n e c t i o n C o n t e x t   c o n n e c t i o n ) 
 
 -         { 
 
 -                 r e t u r n   c o n n e c t i o n . U s e r ? . F i n d F i r s t V a l u e ( " s u b " )   ? ?   c o n n e c t i o n . U s e r ? . F i n d F i r s t V a l u e ( C l a i m T y p e s . N a m e I d e n t i f i e r ) ; 
 
 -         } 
 
 - } 
 
 